:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --bg-color: #f8f9fa;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    padding-bottom: 100px;
    /* Space for action bar */
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
    position: relative;
}

/* Language Switcher */
.language-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    backdrop-filter: blur(5px);
    z-index: 10;
}

.lang-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    transition: color 0.3s ease;
}

.lang-btn.active {
    color: #fff;
}

.lang-btn:hover {
    color: #fff;
}

.separator {
    color: rgba(255, 255, 255, 0.4);
}

/* Stats Badge */
.stats-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    animation: pulse 2s ease-in-out infinite;
}

/* Hero Visual */
.hero-visual {
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.demo-image {
    width: 50% !important;
    max-width: 500px !important;
    height: auto !important;
    max-height: 250px !important;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.floating-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Hero Visual */
.hero-visual {
    margin-top: 2rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.demo-image {
    max-width: 100%;
    height: auto;
    max-height: 400px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
}

.floating-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Examples Section - Compact */
.examples-section.compact {
    text-align: center;
    padding: 1rem;
    margin: 1rem auto;
}

.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-buttons .btn {
    min-width: 200px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-buttons .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.action-buttons .btn i {
    margin-right: 0.5rem;
}


.action-buttons .btn i {
    margin-right: 0.5rem;
}

/* Instructions Modal Content */
.instructions-content {
    max-width: 600px;
    margin: 0 auto;
}

.instruction-step {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: white;
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.step-content {
    flex: 1;
    text-align: left;
}

.step-content h3 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.step-content p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.6;
}


/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95), rgba(118, 75, 162, 0.95));
    margin: 3% auto;
    padding: 0;
    border-radius: 20px;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    color: white;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

.modal-subtitle {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.examples-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.library-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.library-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.library-thumbnail {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f5f5f5;
}

.library-info {
    padding: 1rem;
}

.library-info h3 {
    margin: 0 0 0.75rem 0;
    color: #333;
    font-size: 1.1rem;
}

.library-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-try,
.btn-download {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

.btn-try {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.btn-try:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-download {
    background: #4CAF50;
    color: white;
}

.btn-download:hover {
    background: #45a049;
    transform: scale(1.05);
}

.stats-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stats-badge i {
    color: #FFD700;
    /* Gold color for the fire icon */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo i {
    font-size: 2.5rem;
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Glass Panel Utility */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* Upload Section */
.upload-section {
    background: rgba(255, 255, 255, 0.9);
    border: 2px dashed #cbd5e0;
    border-radius: var(--radius-xl);
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.upload-section:hover,
.upload-section.drag-over {
    border-color: #764ba2;
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.upload-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.limit-badge {
    display: inline-block;
    background: #e2e8f0;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin: 1rem 0;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(118, 75, 162, 0.4);
}

.btn-gradient {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
    width: 100%;
}

.btn-gradient:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Settings Panel */
.settings-panel {
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

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

.select-wrapper select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    font-family: inherit;
    color: var(--text-dark);
    outline: none;
    transition: border-color 0.2s;
}

.select-wrapper select:focus {
    border-color: #764ba2;
}

/* Toggle Switch Styling */
.checkbox-item .toggle-switch {
    position: relative;
    display: inline-block !important;
    width: 50px !important;
    height: 26px !important;
    margin-left: 10px;
    margin-bottom: 0 !important;
    /* Reset label margin */
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background: var(--primary-gradient);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.checkbox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Space out label and toggle */
    padding-top: 1.8rem;
}

.checkbox-item label {
    margin-bottom: 0;
    cursor: pointer;
    font-weight: 500;
}

/* Staging Area */
.staging-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

/* Image Card */
.image-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 1rem;
    position: relative;
    animation: fadeIn 0.4s ease-out;
    transition: transform 0.2s;
}

.image-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-preview {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    background: #f1f2f6;
}

.card-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.file-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.card-settings {
    display: flex;
    gap: 0.5rem;
}

.mini-select {
    padding: 0.25rem 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.75rem;
    background: #f8f9fa;
}

.remove-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.remove-btn:hover {
    transform: scale(1.1);
}

.status-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #e2e8f0;
    color: var(--text-light);
    align-self: flex-start;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.error {
    background: #f8d7da;
    color: #721c24;
}

.status-badge.processing {
    background: #cce5ff;
    color: #004085;
}

/* Action Bar */
.action-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 800px;
    padding: 1rem 2rem;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-container {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: var(--secondary-gradient);
    transition: width 0.3s ease;
}

.action-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-text {
    font-weight: 500;
    color: var(--text-light);
}

.consent-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
    font-size: 0.9rem;
}

.consent-wrapper a {
    color: #764ba2;
    text-decoration: none;
    font-weight: 500;
}

.consent-wrapper a:hover {
    text-decoration: underline;
}

/* Consent Toggle Switch */
.consent-toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.consent-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.consent-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.consent-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.consent-toggle input:checked+.consent-slider {
    background: var(--primary-gradient);
}

.consent-toggle input:checked+.consent-slider:before {
    transform: translateX(24px);
}

.consent-toggle:hover .consent-slider {
    box-shadow: 0 0 8px rgba(118, 75, 162, 0.4);
}

.consent-label {
    cursor: pointer;
    user-select: none;
}

/* Consent Error Message */
.consent-error {
    display: none;
    color: #dc3545;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    background: rgba(220, 53, 69, 0.1);
    border-radius: 8px;
    margin-right: 1rem;
    animation: fadeInError 0.3s ease;
}

.consent-error.visible {
    display: inline-block;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shake animation for toggle when error */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

.consent-toggle.shake {
    animation: shake 0.5s ease;
}

#generate-btn {
    width: auto;
    min-width: 200px;
}

/* Responsive */
@media (max-width: 600px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .action-bar {
        width: 95%;
        padding: 1rem;
    }

    .action-content {
        flex-direction: column;
        gap: 0.75rem;
    }

    .consent-wrapper {
        margin-right: 0;
        justify-content: center;
    }

    .consent-error {
        margin-right: 0;
        text-align: center;
        width: 100%;
    }

    #generate-btn {
        width: 100%;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
    color: var(--text-light);
    /* Changed from white to dark gray */
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 0.5rem;
}

.footer-links a {
    color: var(--primary-color);
    /* Changed to primary color */
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
}

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

.separator {
    margin: 0 0.5rem;
    opacity: 0.5;
}