/* EU-DOC List Page New Styles - 2026 */

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #F1F5F9;
    color: #0F172B;
    line-height: 1.5;
}

/* Layout */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    padding: 24px 32px;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

/* Header Brand (Logo Area) */
.header-brand {
    flex-shrink: 0;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.logo-img {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: block;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-title {
    font-size: 24px;
    font-weight: 700;
    color: #0F172B;
    line-height: 1.333;
    letter-spacing: -0.025em;
}

.logo-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #62748E;
    line-height: 1.428;
}

/* Header Search Area */
.header-search {
    display: flex;
    align-items: center;
    gap: 32px;
}

.header-nav {
    flex-shrink: 0;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: #45556C;
    text-decoration: none;
    line-height: 1.428;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #155DFC;
}

/* Search Form */
.search-form {
    width: 544.7px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    height: 42px;
    box-shadow: 0px 2px 4px -2px rgba(0, 0, 0, 0.1), 0px 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Dropdown */
.search-dropdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    /* padding: 0 15px; */
    margin: 8px;
    height: 40px;
    min-width: 149.14px;
    cursor: pointer;
    position: relative;
    background: #FFFFFF;
    user-select: none;
}

.dropdown-text {
    font-size: 14px;
    font-weight: 500;
    color: #45556C;
    line-height: 1.428;
}

.dropdown-icon {
    color: #45556C;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.search-dropdown:hover {
    background: #F8FAFC;
}

.search-dropdown:hover .dropdown-icon {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 40px;
    left: 0;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06);
    min-width: 160px;
    display: none;
    z-index: 9999;
    overflow: hidden;
    padding: 4px 0;
}

.search-dropdown:hover .dropdown-menu {
    display: block !important;
}

.dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #45556C;
    cursor: pointer;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #F1F5F9;
}

.dropdown-item.active {
    background: #F1F5F9;
    color: #155DFC;
}

/* Divider */
.search-divider {
    width: 1px;
    height: 40px;
    background: #E2E8F0;
    flex-shrink: 0;
}

/* Search Input */
.search-input {
    flex: 1;
    border: none;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    background: transparent;
    color: #0F172B;
    height: 40px;
}

.search-input::placeholder {
    color: #90A1B9;
}

/* Search Button */
.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 23px;
    height: 40px;
    min-width: 92.56px;
    background: linear-gradient(90deg, rgba(21, 93, 252, 1) 0%, rgba(20, 71, 230, 1) 100%);
    color: #FFFFFF;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.428;
}

.search-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0px 4px 6px -1px rgba(43, 127, 255, 0.2), 0px 2px 4px -1px rgba(43, 127, 255, 0.1);
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    width: 100%;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    padding: 16px 0;
    font-size: 14px;
}
.breadcrumbs a {
    color: #155DFC;
    text-decoration: none;
}
.breadcrumbs a:hover {
    text-decoration: underline;
}
.breadcrumbs .current {
    color: #64748B;
}

.content-wrapper {
    display: flex;
    gap: 24px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 113px;
    z-index: 900;
    max-height: calc(100vh - 113px);
    overflow-y: auto;
    align-self: flex-start;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    color: #0F172B;
    margin-bottom: 16px;
    padding-left: 8px;
    line-height: 28px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Standalone "All Categories" card */
.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 87px;
    box-sizing: border-box;
}

.category-item:hover {
    border-color: #94A3B8;
}

.category-item.active {
    border-color: #2B7FFF;
    box-shadow: 0px 4px 6px 0px rgba(43, 127, 255, 0.2), 0px 10px 15px 0px rgba(43, 127, 255, 0.2);
}

/* Category card wrapper — unifies parent + sub-categories in one container */
.category-card {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.2s;
}

.category-card.active {
    border-color: #2B7FFF;
    box-shadow: 0px 4px 6px 0px rgba(43, 127, 255, 0.2), 0px 10px 15px 0px rgba(43, 127, 255, 0.2);
}

.category-card .category-item {
    border: none;
    border-radius: 0;
    box-shadow: none !important;
    background: transparent;
    min-height: 0;
}

.category-card .category-item:hover {
    border-color: transparent;
    background: #F8FAFC;
}

.category-card.active .category-item:hover {
    background: rgba(21, 93, 252, 0.03);
}

.category-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-name {
    font-size: 18px;
    font-weight: 600;
    color: #0F172B;
    line-height: 27px;
}

.category-item.active .category-name,
.category-card.active .category-name {
    color: #155DFC;
}

.category-count {
    font-size: 14px;
    font-weight: 400;
    color: #62748E;
    line-height: 20px;
}

.category-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #155DFC;
    flex-shrink: 0;
}

.category-arrow {
    width: 18px;
    height: 18px;
    color: #94A3B8;
    flex-shrink: 0;
}

/* Divider between parent card and sub-categories */
.sub-category-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 0 18px;
}

.category-card.active .sub-category-divider {
    background: #CBD5E1;
}

/* Sub-category list */
.sub-category-list {
    padding: 8px 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sub-category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
}

.sub-category-item:hover {
    background: #F8FAFC;
}

.sub-category-item.active {
    background: rgba(21, 93, 252, 0.06);
    position: relative;
}

.sub-category-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: #155DFC;
    border-radius: 0 2px 2px 0;
}

.sub-category-name {
    font-size: 14px;
    font-weight: 500;
    color: #45556C;
    line-height: 20px;
}

.sub-category-item.active .sub-category-name {
    color: #155DFC;
}

.sub-category-count {
    font-size: 12px;
    font-weight: 500;
    color: #94A3B8;
    line-height: 18px;
    padding: 2px 8px;
    background: #F1F5F9;
    border-radius: 6px;
    flex-shrink: 0;
}

.sub-category-item.active .sub-category-count {
    background: rgba(21, 93, 252, 0.08);
    color: #155DFC;
}

/* Product Grid */
.product-grid {
    flex: 1;
}

.product-grid-inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Product Card - Strictly following Figma spec */
.product-card {
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
    box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.card-image-wrapper {
    position: relative;
    background: linear-gradient(135deg, rgba(241, 245, 249, 1) 0%, rgba(248, 250, 252, 1) 100%);
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.card-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0px 4px 8px 0px rgba(0, 0, 0, 0.15);
}

.category-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #155DFC;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.333;
    backdrop-filter: blur(4px);
    box-shadow: 0px 1px 2px -1px rgba(0, 0, 0, 0.1), 0px 1px 3px 0px rgba(0, 0, 0, 0.1);
}

.card-content {
    padding: 20px;
    height: 180px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-sizing: border-box;
}

.card-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #0F172B;
    line-height: 1.555;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: calc(1em * 1.555 * 2);
}

.card-subtitle {
    font-size: 14px;
    font-weight: 400;
    color: #62748E;
    line-height: 1.428;
    margin: 0;
}

.lang-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    height: 24px;
}

.lang-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background: #F1F5F9;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #45556C;
    line-height: 1.333;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    height: 24px;
}

.lang-tag:hover {
    background: #E2E8F0;
}

.lang-tag.more {
    background: #F1F5F9;
    color: #45556C;
}

/* No Image Placeholder */
.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94A3B8;
    font-size: 14px;
}

/* Footer */
.footer {
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
    padding: 24px;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    color: #62748E;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .content-wrapper {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: none;
        overflow-y: visible;
        position: sticky;
        top: 0;
        z-index: 900;
    }
    
    .category-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .category-item {
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 16px;
    }
    
    .search-section {
        width: 100%;
    }
    
    .product-grid-inner {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .sidebar {
        top: 180px;
        max-height: calc(100vh - 180px);
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 16px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

.mb-4 {
    margin-bottom: 16px;
}

/* Login Page Modern Split Layout */
.login-page {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 200px);
    width: 100%;
}

.result-page {
    display: flex;
    flex: 1;
    min-height: calc(100vh - 200px);
    width: 100%;
}

.login-left {
    flex: 1;
    background-image: url(../img/MAIN_11.jpg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(21, 93, 252, 0.85) 0%, rgba(15, 23, 43, 0.9) 100%);
}

.login-brand {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #FFFFFF;
    padding: 24px;
}

.login-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.login-subtitle {
    font-size: 18px;
    font-weight: 400;
    opacity: 0.9;
}

.login-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: #F1F5F9;
}

.login-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0px 4px 6px -1px rgba(0, 0, 0, 0.1), 0px 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.login-card-title {
    font-size: 24px;
    font-weight: 700;
    color: #0F172B;
    margin-bottom: 28px;
    text-align: center;
}

.login-card-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.login-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.login-input-label {
    font-size: 14px;
    font-weight: 500;
    color: #45556C;
}

.login-input {
    height: 44px;
    padding: 10px 14px;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 14px;
    color: #0F172B;
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.login-input:focus {
    border-color: #155DFC;
    box-shadow: 0 0 0 3px rgba(21, 93, 252, 0.15);
}

.login-input::placeholder {
    color: #90A1B9;
}

.login-captcha-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.login-input-captcha {
    flex: 1;
}

.login-captcha-img {
    height: 44px;
    display: flex;
    align-items: center;
}

.login-captcha-img img {
    height: 40px;
    border-radius: 6px;
    cursor: pointer;
}

.login-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: #45556C;
}

.login-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #155DFC;
    cursor: pointer;
}

.login-link {
    color: #155DFC;
    text-decoration: none;
    font-weight: 500;
}

.login-link:hover {
    text-decoration: underline;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
}

.login-btn-primary {
    background: linear-gradient(90deg, rgba(21, 93, 252, 1) 0%, rgba(20, 71, 230, 1) 100%);
    color: #FFFFFF;
    width: 100%;
}

.login-btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0px 4px 6px -1px rgba(43, 127, 255, 0.2), 0px 2px 4px -1px rgba(43, 127, 255, 0.1);
}

.login-btn-secondary {
    background: #F1F5F9;
    color: #45556C;
    border: 1px solid #E2E8F0;
    flex: 1;
}

.login-btn-secondary:hover {
    background: #E2E8F0;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94A3B8;
    font-size: 13px;
    margin: 4px 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E2E8F0;
}

.login-actions-row {
    display: flex;
    gap: 12px;
}

@media (max-width: 768px) {
    .login-page {
        flex-direction: column;
    }
    
    .login-left {
        min-height: 200px;
        padding: 40px 24px;
    }
    
    .login-title {
        font-size: 28px;
    }
    
    .login-subtitle {
        font-size: 14px;
    }
    
    .login-right {
        padding: 24px;
    }
    
    .login-card {
        padding: 28px;
        max-width: 100%;
    }
    
    .login-actions-row {
        flex-direction: column;
    }
}
