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

:root {
    /* Primary colors based on your logo */
    --primary: #640206;
    /* Your logo color as primary */
    --primary-dark: #4a0205;
    /* Darker shade for hover states */
    --primary-light: #8b2635;
    /* Lighter burgundy for accents */

    /* Complementary colors */
    --secondary: #f8f6f6;
    /* Warm light gray */
    --accent: #d4af37;
    /* Gold accent (complements burgundy) */
    --success: #16a34a;
    /* Green for success states */
    --danger: #dc2626;
    /* Red for danger (slightly brighter than primary) */
    --warning: #f59e0b;
    /* Amber for warnings */

    /* Neutral colors */
    --dark: #1c1917;
    /* Warm dark gray */
    --gray: #78716c;
    /* Warm medium gray */
    --light-gray: #fafaf9;
    /* Warm off-white */
    --border: #e7e5e4;
    /* Warm border color */

    /* Effects */
    --shadow: 0 10px 25px -5px rgba(100, 2, 6, 0.1), 0 4px 6px -2px rgba(100, 2, 6, 0.05);
    --shadow-lg: 0 25px 50px -12px rgba(100, 2, 6, 0.25);
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);

    /* Border radius */
    --border-radius: 16px;
    --border-radius-sm: 8px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
}

.logo {
    height: 48px;
    width: 48px;
    border-radius: 12px;
    margin-right: 1rem;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.header-title {
    font-size: 1.875rem;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Main Container */
.container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
    border: 1px solid var(--border);
}

.card-header {
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 2rem;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--primary);
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-area:hover::before {
    opacity: 0.05;
}

.upload-area.dragover {
    border-color: var(--primary-dark);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.02);
}

.upload-area input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.upload-text {
    font-size: 1.125rem;
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.upload-subtext {
    font-size: 0.875rem;
    color: var(--gray);
    position: relative;
    z-index: 1;
}

/* Form Elements */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Range Slider */
.range-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.range-input {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.range-value {
    background: var(--gradient);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 40px;
    text-align: center;
}

/* Checkbox */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.checkbox input {
    opacity: 0;
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.checkbox input:checked+.checkmark::after {
    display: block;
}

.checkmark::after {
    content: '\2713';
    position: absolute;
    top: -2px;
    left: 2px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: none;
}

.checkbox input:checked~.checkmark {
    background: var(--gradient);
    border-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.btn:hover::before {
    transform: translateX(100%);
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary:disabled:hover {
    transform: none;
    background: var(--secondary);
}

/* Status Cards */
.status-card {
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.loading-card {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 1px solid #93c5fd;
}

.result-card {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid #6ee7b7;
}

.error-card {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border: 1px solid #f87171;
}

.status-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.loading-card .status-icon {
    color: #3b82f6;
    animation: spin 2s linear infinite;
}

.result-card .status-icon {
    color: var(--accent);
}

.error-card .status-icon {
    color: var(--danger);
}

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

    to {
        transform: rotate(360deg);
    }
}

/* Result Image */
.result-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

/* Button Container */
.button-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Info Section */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.info-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-palette {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
    background: var(--light-gray);
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.color-name {
    font-size: 0.75rem;
    font-weight: 500;
}

.tips-list {
    list-style: none;
    space-y: 0.5rem;
}

.tips-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}

.tips-list li::before {
    content: '💡';
    font-size: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 1.5rem 2rem;
    color: var(--gray);
    font-size: 0.875rem;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.footer a:hover {
    text-decoration: underline;
}

.language-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 20px;
}

.language-btn {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.language-btn:hover {
    border-color: #dc2626;
    background: #fef2f2;
}

.language-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    display: none;
    z-index: 1000;
}

.language-options.show {
    display: block;
}

.language-option {
    padding: 10px 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s ease;
}

.language-option:hover {
    background: #f3f4f6;
}

.language-option.active {
    background: #fef2f2;
    color: #dc2626;
    font-weight: 500;
}

.flag {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    display: inline-block;
}

.flag-en {
    background: linear-gradient(to bottom, #012169 0%, #012169 33%, #fff 33%, #fff 66%, #c8102e 66%);
    position: relative;
}

.flag-en::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(45deg, transparent 40%, #fff 40%, #fff 45%, transparent 45%),
        linear-gradient(-45deg, transparent 40%, #fff 40%, #fff 45%, transparent 45%),
        linear-gradient(45deg, transparent 47%, #c8102e 47%, #c8102e 53%, transparent 53%),
        linear-gradient(-45deg, transparent 47%, #c8102e 47%, #c8102e 53%, transparent 53%);
}

.flag-pt {
    background: linear-gradient(to right, #046A38 0%, #046A38 40%, #DA020E 40%);
    position: relative;
}

.flag-pt::before {
    content: '';
    position: absolute;
    left: 35%;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #FFD700;
    border: 1px solid #DA020E;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
        margin: 1rem auto;
    }

    .card-body {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .button-container {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .header-title {
        font-size: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-icon {
        font-size: 2rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 1rem;
    }

    .logo {
        height: 40px;
        width: 40px;
        font-size: 1.25rem;
    }

    .upload-area {
        padding: 1.5rem 1rem;
    }

    .range-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
}