/* The Color Edit - Main Stylesheet */

/* Google Fonts - Playfair Display for headers, Lato for body text */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Lato:wght@300;400;700&display=swap');

:root {
    /* Color palette */
    --primary: #333333;
    --secondary: #f8f9fa;
    --accent: #e0e0e0;
    --text-dark: #212529;
    --text-light: #6c757d;
    --white: #ffffff;
    --error: #dc3545;
    --success: #28a745;
}

/* Base styles */
body {
    font-family: 'Lato', sans-serif;
    color: var(--text-dark);
    background-color: var(--white);
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

.logo-container {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.navbar-logo {
    height: 40px;
    margin-right: 10px;
    border-radius: 4px;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--primary);
    text-decoration: none;
}

.logo-container:hover {
    text-decoration: none;
}

.logo-container:hover .logo {
    color: var(--primary);
    text-decoration: none;
}

/* Navigation */
.navbar {
    background-color: var(--white);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Container styling */
.main-container {
    min-height: calc(100vh - 180px); /* Adjust for footer and header */
    padding: 2rem 0;
}

/* Forms and inputs */
.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.25rem rgba(224, 224, 224, 0.25);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: #444444;
    border-color: #444444;
    box-shadow: none;
    outline: none;
}

.btn-primary:active, .btn-primary:focus:active {
    background-color: #444444;
    border-color: #444444;
    box-shadow: none;
    outline: none;
}

.btn:focus, .btn:active:focus {
    box-shadow: none;
    outline: none;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline-primary:hover, .btn-outline-primary:focus {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
    outline: none;
}

.btn-outline-primary:active, .btn-outline-primary:focus:active {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: none;
    outline: none;
}

/* File upload */
.file-upload-container {
    border: 2px dashed var(--accent);
    border-radius: 5px;
    padding: 1rem;
    text-align: center;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    height: 100%;
}

.file-upload-container:hover {
    border-color: var(--primary);
    background-color: #f0f0f0;
}

.upload-box {
    padding: 3rem 2rem;
    border-radius: 12px;
    background-color: var(--white);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #eaeaea;
    height: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
    border-color: #d0d0d0;
}

.file-upload-container label {
    cursor: pointer;
}

.file-upload-input {
    display: none;
}

/* Minimal Upload Box */
.upload-box-minimal {
    padding: 3rem 2rem;
    border-radius: 8px;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #e8e8e8;
    height: 100%;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.upload-box-minimal:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.upload-box-minimal h4 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    text-align: center;
    margin-top: 0;
}

.upload-box-minimal p {
    color: var(--text-light);
    margin-bottom: 0;
    text-align: center;
    font-size: 1rem;
}

.upload-box-minimal small {
    color: var(--text-light);
    font-size: 0.85rem;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(20px);
}

/* Minimal Image Preview */
.image-preview-minimal {
    min-height: 300px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.image-preview-minimal img {
    max-width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.preview-placeholder-minimal {
    opacity: 0.6;
}

.preview-placeholder-minimal i {
    display: block;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.preview-placeholder-minimal p {
    margin: 0;
    font-size: 1rem;
    color: var(--text-light);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .upload-section {
        padding: 32px 0;
    }
    
    .row.align-items-center {
        flex-direction: column;
    }
    
    .col-md-7, .col-md-5 {
        width: 100%;
        max-width: 100%;
    }
    
    .upload-box-minimal {
        min-height: 250px;
        padding: 2rem 1.5rem;
        margin-bottom: 1rem;
    }
    
    #imagePreview {
        min-height: 250px;
        margin-top: 1.5rem;
    }
    
    .btn-lg {
        font-size: 1.125rem;
        padding: 0.75rem 1.5rem;
        width: 100%;
        margin-top: 1.5rem;
        min-height: 48px; /* Minimum touch target size */
    }
    
    .upload-box h4 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
    
    .upload-box p {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .upload-box small {
        font-size: 0.875rem;
    }
    
    /* Ensure text is readable and touch targets are adequate */
    .preview-placeholder i {
        font-size: 2.5rem !important;
        margin-bottom: 1rem !important;
    }
    
    .preview-placeholder p {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    /* Mobile spacing improvements */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .my-5 {
        margin-top: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    /* Touch-friendly file upload area */
    .upload-box-minimal {
        border: 1px solid #e8e8e8;
        transition: all 0.2s ease;
    }
    
    .upload-box-minimal:active {
        transform: scale(0.98);
        background-color: #f8f8f8;
    }
    
    /* Homepage mobile spacing */
    .hero {
        padding: 3rem 1rem 4rem 1rem !important;
    }
    
    .steps-section {
        padding: 3rem 0 !important;
    }
    
    .py-5 {
        padding: 3rem 0 !important;
    }
    
    .hero h1 {
        margin-bottom: 1.5rem !important;
    }
    
    .hero p {
        margin-bottom: 2rem !important;
    }
    
    .col-md-6 h2 {
        margin-bottom: 1.5rem !important;
    }
    
    .col-md-6 p {
        margin-bottom: 1.25rem !important;
    }
    
    .text-center h4.mb-3 {
        margin-bottom: 1.5rem !important;
        margin-top: 2rem !important;
    }
    
    /* Specific spacing for homepage sections */
    .row.align-items-center {
        margin-bottom: 2rem;
    }
    
    .row.align-items-center .col-md-6:first-child {
        margin-bottom: 2rem;
    }
    
    .btn.btn-outline-primary {
        margin-top: 1rem;
        margin-bottom: 2rem;
    }
    
    /* Footer mobile spacing */
    footer {
        padding: 2rem 0 !important;
    }
    
    footer .row {
        gap: 1.5rem;
    }
    
    footer .col-md-6 {
        margin-bottom: 1rem;
    }
}

/* Color swatches */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 2rem 0;
}

.color-swatch {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.swatch {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.swatch-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

.swatch-hex {
    font-size: 0.8rem;
    font-family: monospace;
}

/* Avoid colors styling */
.avoid-palette {
    opacity: 0.95;
}

.avoid-swatch .swatch {
    position: relative;
}

.avoid-x::before,
.avoid-x::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
}

.avoid-x::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.avoid-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Brand selection */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.brand-checkbox {
    display: none;
}

.brand-label {
    display: block;
    padding: 0.75rem;
    background-color: var(--secondary);
    border: 1px solid var(--accent);
    border-radius: 5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.brand-checkbox:checked + .brand-label {
    background-color: #f8f9fa;
    border: 2px solid #6E4C5B;
    color: #495057;
}

/* Flash messages */
.alert {
    border-radius: 3px;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background-color: var(--secondary);
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Homepage styling */
.hero {
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 2rem;
    color: var(--text-light);
}

.steps-section {
    padding: 3rem 0;
    background-color: var(--secondary);
}

.step-item {
    text-align: center;
    padding: 1.5rem;
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background-color: #6E4C5B;
    color: var(--white);
    border-radius: 50%;
    margin-bottom: 1rem;
}

/* Results page */
.results-container {
    background-color: var(--secondary);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.user-image {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.highlight {
    color: #8B6645; /* Dark autumn brownish tone */
    font-weight: 700;
    border-bottom: 2px solid #8B6645;
    padding-bottom: 3px;
}

/* Admin page */
.admin-header {
    background-color: var(--primary);
    color: var(--white);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

.submission-card {
    border: 1px solid var(--accent);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-swatch {
    width: 30px;
    height: 30px;
    display: inline-block;
    margin-right: 10px;
    border-radius: 3px;
}

/* Brand status styling */
.brand-item {
    transition: all 0.3s ease;
}

.brand-inactive {
    opacity: 0.4;
    filter: grayscale(70%);
}

.brand-label {
    min-height: 70px;
    padding: 16px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
}

.brand-active .brand-label {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    color: #495057;
    font-weight: 600;
}

.brand-disabled .brand-label {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.brand-name {
    font-weight: 500;
    font-size: 0.95rem;
}

.badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* Admin Interface Styling */
.admin-header-refined {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.admin-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 0;
}

.admin-subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: 400;
}

.admin-icon {
    opacity: 0.8;
}

.admin-stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 1.5rem;
    width: 60px;
    height: 60px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
    font-family: 'Playfair Display', serif;
}

.stat-description {
    font-size: 0.8rem;
    color: var(--text-light);
    margin: 0;
}

.admin-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.admin-card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e8e8e8;
}

.admin-card-header h5 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--primary);
}

.admin-test-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.admin-test-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.test-card-icon {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.test-card-content {
    flex: 1;
}

.test-card-title {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.test-card-text {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.btn-admin-primary {
    background: linear-gradient(135deg, #6E4C5B 0%, #5A3F4A 100%);
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-admin-primary:hover {
    background: linear-gradient(135deg, #5A3F4A 0%, #4A3239 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(110, 76, 91, 0.3);
}

.btn-admin-secondary {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    color: var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-admin-secondary:hover {
    background: #e9ecef;
    border-color: #d6d6d6;
    color: var(--primary);
    transform: translateY(-1px);
}

/* Enhanced table styling for admin */
.admin-card .table {
    margin-bottom: 0;
}

.admin-card .table th {
    background: #f8f9fa;
    border-bottom: 2px solid #e8e8e8;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.9rem;
    padding: 1rem 0.75rem;
}

.admin-card .table td {
    padding: 0.875rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.admin-card .table-striped tbody tr:nth-of-type(odd) {
    background-color: #fafbfc;
}

.badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Form controls in admin */
.admin-card .form-control,
.admin-card .form-select {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.admin-card .form-control:focus,
.admin-card .form-select:focus {
    border-color: #6E4C5B;
    box-shadow: 0 0 0 0.2rem rgba(110, 76, 91, 0.15);
}

/* Media queries */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .color-palette {
        justify-content: center;
    }
    
    .step-item {
        margin-bottom: 2rem;
    }
    
    .admin-header-refined {
        padding: 1.5rem;
    }
    
    .admin-header-refined .d-flex {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .admin-title {
        font-size: 1.8rem;
    }
    
    .admin-stat-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .admin-test-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .test-card-icon {
        margin: 0 auto;
    }
}
