/* styles/main.css */
:root {
    /* Blue Color Palette */
    --primary-blue: #2563eb;
    --blue-600: #2563eb;
    --blue-500: #3b82f6;
    --blue-400: #60a5fa;
    --blue-300: #93c5fd;
    --blue-200: #bfdbfe;
    --blue-100: #dbeafe;
    
    /* Light Green Color Palette */
    --light-green: #86efac;
    --green-400: #4ade80;
    --green-300: #86efac;
    --green-200: #bbf7d0;
    --green-100: #dcfce7;
    
    /* Additional Colors */
    --orange-100: #ffedd5;
    --orange-800: #9a3412;
    
    /* Neutral Colors */
    --dark: #1e293b;
    --dark-2: #334155;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --border: #e2e8f0;
    --light: #f8fafc;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, #1d4ed8 100%);
    --gradient-hero: linear-gradient(135deg, var(--primary-blue) 0%, var(--light-green) 100%);
    --gradient-green: linear-gradient(135deg, var(--light-green) 0%, var(--green-400) 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Font Families */
    --font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --font-family-zh: "Microsoft YaHei", "SimHei", "PingFang SC", sans-serif;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--dark);
    background: var(--white);
    overflow-x: hidden;
}

body[lang="zh"] {
    font-family: var(--font-family-zh);
}

body[lang="en"] {
    font-family: var(--font-family);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2.25rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    margin-bottom: 1rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--dark);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Buttons */
.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: 12px 28px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: 12px 28px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-view {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-view:hover {
    background: var(--primary-blue);
    color: var(--white);
    transform: translateY(-2px);
}

/* Image Handling */
img {
    max-width: 100%;
    height: auto;
}

/* Fallback for missing images */
.model-image {
    position: relative;
}

.model-image img:not([src]),
.model-image img[src=""],
.model-image img[src*="placeholder"] {
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    min-height: 200px;
}

.brand-logo img:not([src]),
.brand-logo img[src=""],
.brand-logo img[src*="placeholder"] {
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    min-height: 60px;
    font-size: 0.8rem;
    text-align: center;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Skeleton Loading */
.loading-skeleton .skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Make Load More button visible */
.load-more-container {
    text-align: center;
    margin: 40px 0 !important;
    padding: 20px 0 !important;
    display: block !important;
    width: 100%;
    grid-column: 1 / -1;
}

#loadMoreBtn {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 auto !important;
    padding: 15px 40px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    background-color: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3) !important;
}

#loadMoreBtn:hover {
    background-color: #0056b3 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4) !important;
}

#loadMoreBtn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

/* LOAD MORE BUTTON FIX */
#loadMoreBtn {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 100 !important;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 15px 35px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 30px auto !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important;
    transition: all 0.3s ease !important;
}

#loadMoreBtn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6) !important;
}

.load-more-container {
    text-align: center;
    margin: 40px 0;
    padding: 20px;
    grid-column: 1 / -1;
    display: block !important;
}

/* ====== FIXED AUTH MODAL STYLES ====== */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.modal-scroll-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 20px;
    overflow-y: auto;
    max-height: 100vh;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 40px);
}

.auth-modal {
    display: flex;
    flex-direction: column;
    height: 100%;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #eee;
}

.close-modal:hover {
    color: #000;
    background: #fff;
    border-color: #ddd;
}

.modal-header {
    padding: 25px 30px 15px 30px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    color: #333;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
}

.modal-body {
    padding: 20px 30px;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.modal-footer {
    padding: 15px 30px 25px 30px;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    flex-shrink: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    box-sizing: border-box;
    background: #fff;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Password Toggle Styles */
.password-group {
    position: relative;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 45px;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: color 0.3s;
    z-index: 10;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.password-toggle:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
}

.btn-full {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.auth-switch {
    margin: 0;
    text-align: center;
    font-size: 14px;
    color: #666;
}

.auth-switch a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.auth-switch a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
    font-size: 14px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Auth buttons in header */
.auth-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 15px;
}

.btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-outline {
    background-color: transparent;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline:hover {
    background-color: #007bff;
    color: white;
}

#user-menu {
    display: flex;
    align-items: center;
}

.user-name {
    font-weight: 600;
    color: #333;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-scroll-container {
        padding: 10px;
        align-items: flex-start;
        padding-top: 40px;
    }
    
    .modal-content {
        max-height: calc(100vh - 50px);
        max-width: 95%;
    }
    
    .modal-header {
        padding: 20px 20px 15px 20px;
    }
    
    .modal-body {
        padding: 15px 20px;
    }
    
    .modal-footer {
        padding: 15px 20px 20px 20px;
    }
    
    .modal-header h2 {
        font-size: 22px;
    }
    
    .auth-buttons {
        margin-right: 10px;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 13px;
    }
    
    .user-name {
        font-size: 14px;
        margin-right: 5px;
    }
}

/* Fix for very small screens */
@media (max-height: 600px) {
    .modal-scroll-container {
        padding: 5px;
        padding-top: 20px;
    }
    
    .modal-content {
        max-height: calc(100vh - 25px);
    }
    
    .modal-header {
        padding: 15px 20px 10px 20px;
    }
    
    .modal-body {
        padding: 10px 20px;
        max-height: calc(100vh - 200px);
    }
    
    .modal-footer {
        padding: 10px 20px 15px 20px;
    }
}