:root {
    /* Cores do Canadá */
    --canada-red: #FF0000;
    --canada-red-dark: #CC0000;
    --canada-red-light: #FF3333;
    --canada-white: #FFFFFF;
    --canada-cream: #FFF8F0;
    --canada-maple: #B22222;
    
    /* Gradientes Canadenses */
    --primary-gradient: linear-gradient(135deg, var(--canada-red) 0%, var(--canada-red-dark) 100%);
    --secondary-gradient: linear-gradient(135deg, var(--canada-red-light) 0%, var(--canada-maple) 100%);
    --accent-gradient: linear-gradient(135deg, var(--canada-white) 0%, var(--canada-cream) 100%);
    --success-gradient: linear-gradient(135deg, var(--canada-red) 0%, var(--canada-red-light) 100%);
    --warning-gradient: linear-gradient(135deg, var(--canada-maple) 0%, var(--canada-red) 100%);
    --dark-gradient: linear-gradient(135deg, #2c1810 0%, #3d1f14 100%);
    
    /* Cores de texto */
    --text-dark: #2c1810;
    --text-light: var(--canada-white);
    --text-muted: #8B4513;
    --text-accent: var(--canada-red);
    
    /* Sombras com tema canadense */
    --shadow-light: 0 8px 32px rgba(255, 0, 0, 0.2);
    --shadow-medium: 0 15px 35px rgba(204, 0, 0, 0.3);
    --shadow-heavy: 0 20px 40px rgba(178, 34, 34, 0.4);
    
    --border-radius: 20px;
    --border-radius-large: 25px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    /* Backgrounds com tema canadense */
    --bg-main: linear-gradient(135deg, var(--canada-red) 0%, var(--canada-white) 25%, var(--canada-red-light) 50%, var(--canada-white) 75%, var(--canada-red-dark) 100%);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 0, 0, 0.3);
}

[data-theme="dark"] {
    /* Tema escuro canadense */
    --bg-main: linear-gradient(135deg, #2c1810 0%, var(--canada-red-dark) 25%, #1a0a0a 50%, var(--canada-red) 75%, #2c1810 100%);
    --glass-bg: rgba(40, 20, 20, 0.85);
    --glass-border: rgba(255, 51, 51, 0.4);
    --text-dark: var(--canada-cream);
    --text-accent: var(--canada-red-light);
    --shadow-light: 0 8px 32px rgba(255, 51, 51, 0.3);
    --shadow-medium: 0 15px 35px rgba(204, 0, 0, 0.4);
    --shadow-heavy: 0 20px 40px rgba(178, 34, 34, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-main);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: var(--text-dark);
    position: relative;
    overflow-x: hidden;
    transition: var(--transition);
    /* Adicionar padrão sutil canadense */
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 0, 0, 0.03) 2px, transparent 2px),
        radial-gradient(circle at 80% 80%, rgba(255, 0, 0, 0.02) 1px, transparent 1px),
        radial-gradient(circle at 40% 60%, rgba(255, 0, 0, 0.01) 1px, transparent 1px);
    background-size: 200px 200px, 300px 300px, 150px 150px;
    background-position: 0 0, 100px 100px, 50px 150px;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(204, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(178, 34, 34, 0.3) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    transition: var(--transition);
}

[data-theme="dark"] body::before {
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 51, 51, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(204, 0, 0, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(178, 34, 34, 0.2) 0%, transparent 50%);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.header-content {
    position: relative;
    z-index: 2;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    display: flex;
    gap: 0.5rem;
}

.theme-btn, .install-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-light);
}

.theme-btn:hover, .install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

.theme-btn:hover {
    transform: scale(1.1) rotate(180deg);
}

.install-btn {
    background: rgba(var(--canada-red), 0.2);
    border-color: rgba(var(--canada-red), 0.4);
    animation: pulse-install 2s infinite;
}

.install-btn:hover {
    background: rgba(var(--canada-red), 0.4);
    transform: scale(1.1) rotate(15deg);
}

@keyframes pulse-install {
    0%, 100% { box-shadow: var(--shadow-light); }
    50% { box-shadow: var(--shadow-heavy), 0 0 20px rgba(255, 0, 0, 0.4); }
}

/* PWA Notifications */
.pwa-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-heavy);
    animation: slideInRight 0.3s ease-out;
}

.notification-content {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
}

.notification-content i {
    font-size: 1.25rem;
    min-width: 20px;
}

.notification-content span {
    flex: 1;
    font-weight: 500;
}

.update-btn, .close-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
    font-weight: 500;
}

.close-btn {
    background: rgba(255, 0, 0, 0.1);
    color: var(--canada-red);
    padding: 0.25rem 0.5rem;
    min-width: 30px;
    border-radius: 50%;
}

.update-btn:hover, .close-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-light);
}

.success-notification .notification-content i {
    color: #28a745;
}

.error-notification .notification-content i {
    color: #dc3545;
}

.info-notification .notification-content i {
    color: var(--canada-red);
}

.update-notification .notification-content i {
    color: #007bff;
    animation: spin 2s linear infinite;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsividade PWA */
@media (max-width: 768px) {
    .pwa-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .theme-toggle {
        top: 0.5rem;
        right: 0.5rem;
        gap: 0.25rem;
    }
    
    .theme-btn, .install-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 50px 50px;
    box-shadow: var(--shadow-medium);
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 0, 0, 0.1), transparent);
    animation: canadianRotate 20s linear infinite;
    pointer-events: none;
}

/* Adicionar folhas de maple decorativas */
header::after {
    content: '🍁';
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 2rem;
    animation: floatMaple 3s ease-in-out infinite alternate;
    z-index: 1;
}

@keyframes canadianRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes floatMaple {
    from { transform: translateY(0px) rotate(0deg); }
    to { transform: translateY(-10px) rotate(15deg); }
}

header h1 {
    color: var(--text-light);
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: 2px;
    position: relative;
    z-index: 2;
    background: linear-gradient(
        45deg,
        var(--canada-red) 0%,
        var(--canada-white) 30%,
        var(--canada-red) 60%,
        var(--canada-white) 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: canadianGradient 4s ease-in-out infinite;
}

header h1::before {
    content: '🍁';
    position: absolute;
    left: -60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    -webkit-text-fill-color: var(--canada-red);
    animation: mapleRotate 6s linear infinite;
}

header h1::after {
    content: '🍁';
    position: absolute;
    right: -60px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8em;
    -webkit-text-fill-color: var(--canada-red);
    animation: mapleRotate 6s linear infinite reverse;
}

@keyframes canadianGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes mapleRotate {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

@keyframes textGlow {
    from { filter: drop-shadow(0 0 5px rgba(79, 172, 254, 0.5)); }
    to { filter: drop-shadow(0 0 20px rgba(79, 172, 254, 0.8)); }
}

header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    position: relative;
    z-index: 2;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Search Section */
.search-section, .image-generation-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-large);
    padding: 2.5rem;
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.search-section::before, .image-generation-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: var(--transition);
}

.search-section:hover::before, .image-generation-section:hover::before {
    left: 100%;
}

.search-section:hover, .image-generation-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-container, .generation-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
}

/* Image Generation Section */
.image-generation-section h2 {
    background: var(--secondary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    animation: pulse 2s ease-in-out infinite alternate;
}

@keyframes pulse {
    from { filter: drop-shadow(0 0 5px rgba(245, 87, 108, 0.3)); }
    to { filter: drop-shadow(0 0 15px rgba(245, 87, 108, 0.6)); }
}

.generation-options {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

#promptInput, #searchInput {
    padding: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
    color: var(--text-dark);
    font-weight: 500;
}

#promptInput:focus, #searchInput:focus {
    outline: none;
    border-color: rgba(79, 172, 254, 0.6);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(79, 172, 254, 0.3);
    transform: translateY(-2px);
}

#imageResolution, #mediaType {
    padding: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    min-width: 200px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-dark);
}

#imageResolution:hover, #mediaType:hover {
    border-color: rgba(79, 172, 254, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#generateBtn, #searchBtn {
    background: linear-gradient(135deg, var(--canada-red) 0%, #cc0000 100%);
    color: var(--canada-white);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 1.2rem 2.5rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#generateBtn::before, #searchBtn::before {
    content: '🍁';
    position: absolute;
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 1;
}

#generateBtn::after, #searchBtn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
    z-index: 0;
}

#generateBtn:hover, #searchBtn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        var(--shadow-heavy),
        0 0 30px rgba(255, 0, 0, 0.4);
    background: linear-gradient(135deg, #cc0000 0%, var(--canada-red) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    padding-left: calc(2.5rem + 25px);
}

#generateBtn:hover::before, #searchBtn:hover::before {
    left: 10px;
    opacity: 1;
}

#generateBtn:hover::after, #searchBtn:hover::after {
    left: 100%;
}

#generateBtn:active, #searchBtn:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

/* Generated Image Styles */
.generated-image-container {
    grid-column: 1 / -1;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.generated-image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: var(--warning-gradient);
    color: white;
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 700px;
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.generated-image-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
}

.generated-image-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
}

.resolution-badge {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0.7rem 1.2rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.generated-image-card {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}

.generated-image-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        rgba(255, 255, 255, 0.1) 0%,
        transparent 20%,
        transparent 80%,
        rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
    z-index: 1;
}

.generated-image-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        var(--shadow-heavy),
        0 20px 40px rgba(79, 172, 254, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.generated-image-card img {
    width: 100%;
    max-width: 450px;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    z-index: 2;
}

.generated-image-card img:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.generated-image-info {
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.generated-image-info p {
    margin-bottom: 1rem;
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.7);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.generated-image-info p:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateX(5px);
}

.click-hint {
    color: #4facfe !important;
    font-size: 0.95rem !important;
    text-align: center;
    margin-top: 1.5rem !important;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-weight: 600 !important;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-5px); }
    60% { transform: translateY(-3px); }
}

.click-hint i {
    margin-right: 0.7rem;
    color: #4facfe;
    animation: pointPulse 1.5s ease-in-out infinite;
}

@keyframes pointPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.generated-image-actions {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Generated Modal Styles */
.generated-modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.generated-modal-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
}

.generated-modal-info {
    text-align: center;
    color: #333;
}

.generated-modal-info h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.generated-modal-info p {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

/* Text Overlay Styles */
.text-overlay-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

.text-overlay-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.text-toggle {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.text-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #ccc 0%, #ddd 100%);
    transition: var(--transition);
    border-radius: 30px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: white;
    transition: var(--transition);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

input:checked + .toggle-slider {
    background: var(--accent-gradient);
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.3);
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.toggle-label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.text-config {
    display: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.text-config::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    animation: rotate 15s linear infinite;
    pointer-events: none;
}

.text-config.active {
    border-color: rgba(79, 172, 254, 0.5);
    box-shadow: 
        var(--shadow-light),
        0 0 30px rgba(79, 172, 254, 0.2);
    display: block;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-config-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.text-config-row:last-child {
    margin-bottom: 0;
}

.config-group {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    flex: 1;
    min-width: 160px;
}

.config-group label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

#overlayText {
    flex: 1;
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-dark);
    font-weight: 500;
}

#overlayText:focus {
    outline: none;
    border-color: rgba(79, 172, 254, 0.6);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 20px rgba(79, 172, 254, 0.3);
    transform: translateY(-2px);
}

#textColor {
    width: 70px;
    height: 45px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#textColor:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

#textSize, #textAlignment {
    padding: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-dark);
    font-weight: 500;
}

#textSize:hover, #textAlignment:hover {
    border-color: rgba(79, 172, 254, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Dual Download Info */
.dual-download-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #e8f4f8;
    border: 1px solid #bee5eb;
    border-radius: 6px;
    color: #0c5460;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-width: 250px;
}

.dual-download-info i {
    color: #17a2b8;
}

/* Temporary Message Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.temporary-message {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.temporary-message .message-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Translation Info */
.translation-info {
    background: #e8f4f8;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 0.8rem;
    margin: 0.5rem 0;
    display: none; /* Hidden by default */
}

.translation-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.translation-label {
    font-size: 0.9rem;
    color: #0c5460;
    font-weight: 600;
}

.translated-text {
    font-size: 0.9rem;
    color: #155724;
    background: #d1ecf1;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-style: italic;
}

/* Hidden elements by default */
#filtersSection,
#loading,
#resultsInfo,
#pagination,
#modal,
#dualDownloadInfo {
    display: none;
}

#searchInput {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
}

.search-options {
    display: flex;
    gap: 1rem;
    align-items: center;
}

#mediaType {
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    background: white;
    flex: 1;
}

#searchBtn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    flex: 1;
}

#searchBtn:hover {
    transform: translateY(-2px);
}

/* Hidden elements by default */
.hidden {
    display: none !important;
}

.translation-info {
    background: #e8f4f8;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 0.8rem;
    margin: 0.5rem 0;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    align-items: center;
    gap: 0.5rem;
}

.translation-info i {
    color: #0c63e4;
    font-size: 1.1em;
}

.filters-section {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    display: none;
}

.loading {
    text-align: center;
    padding: 3rem;
    font-size: 1.2rem;
    color: white;
    display: none;
}

.pagination {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filters select {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    flex: 1;
    min-width: 150px;
}

.loading i {
    font-size: 2rem;
    margin-right: 1rem;
}

/* Results Info */
.results-info {
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: bold;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.media-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.media-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.media-item img,
.media-item video {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

.media-info {
    padding: 1rem;
}

.media-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.media-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.media-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-light);
}

.btn::before {
    content: '🍁';
    position: absolute;
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
    font-size: 1.2rem;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 1;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
    z-index: 0;
}

.btn:hover::before {
    left: 10px;
    opacity: 1;
}

.btn:hover::after {
    left: 100%;
}

.btn:hover {
    padding-left: calc(2rem + 25px);
}

.btn-primary {
    background: var(--success-gradient);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        var(--shadow-heavy),
        0 0 25px rgba(67, 233, 123, 0.4);
    background: var(--accent-gradient);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-dark);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-heavy);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #5a6268;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 2rem;
}

.pagination button {
    padding: 0.8rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.pagination button:not(:disabled):hover {
    background: #5a6fd8;
}

#pageInfo {
    font-weight: bold;
    color: #333;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Folhas de maple flutuantes */
.maple-leaves {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.maple-leaf {
    position: absolute;
    color: var(--canada-red);
    font-size: 2rem;
    opacity: 0.1;
    animation: fall linear infinite;
}

.maple-leaf:nth-child(1) {
    left: 10%;
    animation-duration: 15s;
    animation-delay: 0s;
}

.maple-leaf:nth-child(2) {
    left: 20%;
    animation-duration: 20s;
    animation-delay: 2s;
    font-size: 1.5rem;
}

.maple-leaf:nth-child(3) {
    left: 30%;
    animation-duration: 18s;
    animation-delay: 4s;
    font-size: 2.5rem;
}

.maple-leaf:nth-child(4) {
    left: 50%;
    animation-duration: 22s;
    animation-delay: 1s;
}

.maple-leaf:nth-child(5) {
    left: 70%;
    animation-duration: 16s;
    animation-delay: 6s;
    font-size: 1.8rem;
}

.maple-leaf:nth-child(6) {
    left: 80%;
    animation-duration: 19s;
    animation-delay: 3s;
}

.maple-leaf:nth-child(7) {
    left: 90%;
    animation-duration: 21s;
    animation-delay: 5s;
    font-size: 1.3rem;
}

@keyframes fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

[data-theme="dark"] .maple-leaf {
    opacity: 0.05;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius-large);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    position: relative;
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.4s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2.2rem;
    cursor: pointer;
    color: white;
    background: var(--warning-gradient);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
}

.close:hover {
    background: var(--secondary-gradient);
    transform: scale(1.1) rotate(90deg);
    box-shadow: var(--shadow-heavy);
}

.modal-body img,
.modal-body video {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.modal-actions {
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.2);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer a {
    color: #67b7ff;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .search-options {
        flex-direction: column;
    }
    
    .filters {
        flex-direction: column;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .media-actions {
        flex-direction: column;
    }
    
    .generated-image-card {
        max-width: 100%;
    }
    
    .generated-image-card img {
        max-width: 100%;
    }
    
    .generated-image-container {
        max-width: 100%;
    }
    
    .generated-image-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        max-width: 100%;
    }
    
    .generated-image-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .translation-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.3rem;
    }
    
    .translated-text {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr;
    }
    
    .search-section, .image-generation-section {
        padding: 1rem;
    }
    
    .image-generation-section h2 {
        font-size: 1.5rem;
    }
    
    .generation-options {
        flex-direction: column;
        gap: 1rem;
    }
    
    .text-config-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .config-group {
        min-width: 100%;
    }
    
    .text-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }
    
    .toggle-label {
        font-size: 1rem;
    }
    
    .generated-image-card {
        max-width: 100%;
        margin: 0;
    }
    
    .generated-image-card img {
        max-width: 300px; /* Menor em telas mobile */
    }
    
    .generated-image-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .dual-download-info {
        min-width: 100%;
        text-align: center;
    }
    
    .generated-image-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .generated-image-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .generated-modal-content img {
        max-height: 50vh;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
}