:root {
    --primary-color: #c7000b;
    --sidebar-bg: #f5f5f5;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e5e5e5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --font-family: 'Inter', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-color);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
    flex-shrink: 0;
}

.logo-container {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
}

.sidebar-logo {
    max-width: 140px;
    height: auto;
    display: block;
}

.brand h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--primary-color);
}

.nav-section {
    margin-bottom: 32px;
}

.nav-section h3 {
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 16px;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 32px;
}

.source-filters,
.format-filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-item input {
    accent-color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.top-bar h1 {
    font-size: 24px;
    font-weight: 600;
}

.search-wrapper input {
    width: 300px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    background: #f9f9f9;
    transition: all 0.2s;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(199, 0, 11, 0.1);
}

.content-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #d1d1d1;
}

.card-image {
    height: 180px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f2ea;
    /* card background */
    border-bottom: 1px solid #f5f5f5;
}

.card-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.file-icon-placeholder {
    width: 64px;
    height: 64px;
    background: #f0f0f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #999;
}

.card-info {
    padding: 16px;
}

.card-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    background: #f0f0f0;
    color: #666;
    text-transform: uppercase;
}

.badge-ai {
    background: #ff7c0020;
    color: #ff7c00;
}

.badge-svg {
    background: #ffb13b20;
    color: #e08e0b;
}

.badge-png {
    background: #2980b920;
    color: #2980b9;
}

.badge-jpg {
    background: #27ae6020;
    color: #27ae60;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: #fff;
    width: 900px;
    max-width: 90%;
    height: 80vh;
    border-radius: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    z-index: 10;
}

.header-info h2 {
    font-size: 20px;
    margin-bottom: 4px;
    line-height: 1.4;
    color: var(--text-primary);
}

.header-info .path-text {
    font-size: 13px;
    color: #888;
    margin: 0;
}

.close-button {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    background: #f5f5f5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 16px;
}

.close-button:hover {
    background: #e5e5e5;
    color: #333;
}

.modal-body {
    display: flex;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.modal-preview {
    flex: 1;
    background: #e7e8e8;
    /* background: #f8f9fa; */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid var(--border-color);
}

.preview-wrapper {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal-details {
    width: 350px;
    padding: 32px;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.variants-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 16px;
    font-weight: 600;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    gap: 12px;
}

.download-item:hover {
    background: #f9f9f9;
    border-color: #d1d1d1;
}

.download-item.active {
    background: #fff5f5;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color) inset;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
    font-weight: 500;
}

.file-type {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    background: #eee;
    color: #555;
    min-width: 36px;
    text-align: center;
}

.file-name {
    font-size: 13px;
    color: #666;
    word-break: break-word;
    line-height: 1.4;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    color: var(--primary-color);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-download svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-download:hover {
    background: var(--primary-color);
    font-size: 13px;
    color: #888;
    margin: 0;
}

.close-button {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    background: #f5f5f5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 16px;
}

.close-button:hover {
    background: #e5e5e5;
    color: #333;
}

.modal-body {
    display: flex;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.modal-preview {
    flex: 1;
    background: #e7e8e8;
    /* background: #f8f9fa; */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid var(--border-color);
}

.preview-wrapper {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal-details {
    width: 350px;
    padding: 32px;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.variants-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 16px;
    font-weight: 600;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    gap: 12px;
}

.download-item:hover {
    background: #f9f9f9;
    border-color: #d1d1d1;
}

.download-item.active {
    background: #fff5f5;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color) inset;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
    font-weight: 500;
}

.file-type {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    background: #eee;
    color: #555;
    min-width: 36px;
    text-align: center;
}

.file-name {
    font-size: 13px;
    color: #666;
    word-break: break-word;
    line-height: 1.4;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    color: var(--primary-color);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-download svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-download:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    background: #f5f5f5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 16px;
}

.close-button:hover {
    background: #e5e5e5;
    color: #333;
}

.modal-body {
    display: flex;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.modal-preview {
    flex: 1;
    background: #e7e8e8;
    /* background: #f8f9fa; */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border-right: 1px solid var(--border-color);
}

.preview-wrapper {
    max-width: 100%;
    max-height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    display: none;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.modal-details {
    width: 350px;
    padding: 32px;
    overflow-y: auto;
    background: #fff;
    display: flex;
    flex-direction: column;
}

.variants-section h3 {
    font-size: 14px;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 16px;
    font-weight: 600;
}

.download-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s;
    cursor: pointer;
    gap: 12px;
}

.download-item:hover {
    background: #f9f9f9;
    border-color: #d1d1d1;
}

.download-item.active {
    background: #fff5f5;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color) inset;
}

.file-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.file-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.meta-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f0f0f0;
    color: #666;
    font-weight: 500;
}

.file-type {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 6px;
    border-radius: 4px;
    background: #eee;
    color: #555;
    min-width: 36px;
    text-align: center;
}

.file-name {
    font-size: 13px;
    color: #666;
    word-break: break-word;
    line-height: 1.4;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    color: var(--primary-color);
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-download svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.btn-download:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px;
    color: #888;
    font-size: 16px;
}

.app-footer {
    padding: 24px;
    text-align: center;
    font-size: 12px;
    color: #888;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.guideline-section {
    padding: 32px;
    background: #fff;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.guideline-content {
    max-width: 800px;
    margin: 0;
}

.guideline-list {
    margin-bottom: 24px;
    padding-left: 20px;
    color: #555;
    line-height: 1.6;
}

.guideline-list li {
    margin-bottom: 8px;
}

.guideline-list a {
    color: var(--primary-color);
    text-decoration: none;
}

.guideline-list a:hover {
    text-decoration: underline;
}

.guideline-image-wrapper {
    display: block;
    margin-top: 16px;



}

.guideline-image {
    max-width: 50%;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* Mobile specific styles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
    color: var(--text-primary);
    border-radius: 4px;
}

.menu-toggle:hover {
    background-color: #f0f0f0;
}

.menu-toggle svg {
    width: 24px;
    height: 24px;
    display: block;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.3s;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: var(--shadow-md);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .top-bar {
        padding: 16px;
    }

    .search-wrapper input {
        width: 100%;
        max-width: 200px;
    }

    .top-bar h1 {
        font-size: 18px;
    }

    .content-scroll-area {
        padding: 16px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .card-image {
        height: 140px;
    }

    .modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .modal-body {
        flex-direction: column;
        overflow-y: auto;
    }

    .modal-preview {
        height: 300px;
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 24px;
    }

    .modal-details {
        width: 100%;
        flex: 1;
        overflow: visible;
    }
}

/* Brand Colors Section */
.brand-colors-section {
    margin-bottom: 40px;
}

.colors-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.color-card {
    border-radius: 4px;
    overflow: hidden;
}

.color-card-header {
    padding: 12px 24px;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
}

.bg-huawei-red {
    background-color: #CE0E2D;
}

.bg-huawei-black {
    background-color: #000000;
}

.color-card-body {
    display: flex;
    border: 1px solid #e5e5e5;
    border-top: none;
    background: #fff;
}

.color-swatch-wrapper {
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e5e5e5;
    min-width: 180px;
}

.color-swatch {
    width: 80px;
    height: 80px;
}

.color-values-table {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.color-value-row {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.color-value-row:last-child {
    border-bottom: none;
}

.cv-label {
    width: 140px;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.cv-value {
    flex: 1;
    font-family: var(--font-family);
    /* Match site font, mono not needed */
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.cv-copy {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cv-copy:hover {
    background-color: #f5f5f5;
    color: #CE0E2D;
}

.cv-copy svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .color-card-body {
        flex-direction: column;
    }

    .color-swatch-wrapper {
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding: 16px;
        min-width: auto;
    }

    .color-swatch {
        width: 60px;
        height: 60px;
    }

    .cv-label {
        width: 100px;
        font-size: 13px;
    }

    .cv-value {
        font-size: 13px;
    }
}