/* === BASE === */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.light {
    background: linear-gradient(135deg, #e0e5ec 0%, #c9d6e8 100%);
    color: #2d3748;
    transition: all 0.4s ease;
}

body.dark {
    background: linear-gradient(135deg, #0a0e1a 0%, #1a1f35 100%);
    color: #e2e8f0;
}

.container {
    max-width: 1600px;
    margin: 40px auto;
    padding: 40px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.dark .container {
    background: rgba(20, 23, 34, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
}

/* === HEADER === */
.header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

.subtitle {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: #a0aec0;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.copyright {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: #718096;
    letter-spacing: 2px;
}

.subtitle::after {
    content: "®";
    font-size: 2rem;
    color: #e53e3e;
}

.copyright::after {
    content: " ©";
    color: #3182ce;
}


/* === MODE INFO === */
.mode-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.current-mode {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.mode-description {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: #a0aec0;
}

/* === MODE TOGGLE CONTAINER === */
.mode-toggle-container {
    margin: 40px 0;
    padding: 30px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mode-label {
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #a0aec0;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: rgba(102, 126, 234, 0.5);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.mode-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.mode-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.mode-desc {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

.mode-btn:not(.active) .mode-title {
    color: #e2e8f0;
}

.mode-btn:not(.active) .mode-desc {
    color: #718096;
}

/* === GRID === */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.category-block {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-block::before {
    content: attr(data-prompt-order);
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #667eea;
}

.category-block:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Priority indicators */
.priority-1 { border-left: 4px solid #FFD700; }
.priority-2 { border-left: 4px solid #FF69B4; }
.priority-3 { border-left: 4px solid #7FFF00; }
.priority-4 { border-left: 4px solid #FFA500; }
.priority-5 { border-left: 4px solid #00FA9A; }

/* Modules spéciaux */
.special-module {
    border: 2px solid;
    animation: pulse-border 2s infinite;
}

.decades-module { border-color: #FF6B6B; }
.color-module { border-color: #4ECDC4; }
.grain-module { border-color: #95E1D3; }
.skin-module { border-color: #F38181; }
.portrait-module { border-color: #AA96DA; }
.camera-module { border-color: #00FFFF; }
.bg-module { border-color: #FFA500; }

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 5px currentColor; }
    50% { box-shadow: 0 0 20px currentColor; }
}

/* === LABELS === */
label {
    display: block;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.label-shot { color: #FFD700; }
.label-protagonist { color: #FF69B4; }
.label-action { color: #7FFF00; }
.label-location { color: #FFA500; }
.label-aesthetic { color: #00FA9A; }
.label-lens { color: #00FFFF; }
.label-background { color: #FFA500; }
.label-decades { color: #FF6B6B; }
.label-color { color: #4ECDC4; }
.label-grain { color: #95E1D3; }
.label-skin { color: #F38181; }
.label-portrait { color: #AA96DA; }

/* === SELECT & INPUT === */
select, input.custom {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: #e2e8f0;
    font-size: 14px;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.3s ease;
    outline: none;
}

select:focus, input.custom:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

body.light select, body.light input.custom {
    background: rgba(255, 255, 255, 0.8);
    color: #2d3748;
    border-color: rgba(0, 0, 0, 0.1);
}

select option {
    background: #1a1f35;
    color: #e2e8f0;
    padding: 10px;
}

body.light select option {
    background: #fff;
    color: #2d3748;
}

.multi {
    height: 160px;
    overflow-y: auto;
}

.multi option {
    padding: 8px 12px;
    margin: 2px 0;
    border-radius: 6px;
    transition: all 0.2s;
}

.multi option:hover {
    background: rgba(102, 126, 234, 0.3);
}

.multi option:checked {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

input.custom {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-style: dashed;
}

input.custom::placeholder {
    color: #718096;
    font-style: italic;
}

/* === GENERATE BUTTON === */
button#generate {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 40px auto;
    padding: 18px 40px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    position: relative;
    overflow: hidden;
}

button#generate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.5s;
}

button#generate:hover::before {
    left: 100%;
}

button#generate:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

body.dark button#generate {
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* === OUTPUT === */
.output-container {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.prompt-section {
    display: grid;
    gap: 25px;
}

.prompt-block {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 25px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.prompt-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

body.light .prompt-block {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.1);
}

.prompt-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.prompt-block div[id^="prompt"] {
    font-family: 'Rajdhani', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: #e2e8f0;
    word-break: break-word;
    white-space: pre-wrap;
    padding: 15px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    min-height: 100px;
}

body.light .prompt-block div[id^="prompt"] {
    color: #2d3748;
    background: rgba(0, 0, 0, 0.05);
}

/* Colored text in prompts */
.colored-text {
    display: inline;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

.colored-shot { color: #FFD700; background: rgba(255, 215, 0, 0.1); }
.colored-protagonist { color: #FF69B4; background: rgba(255, 105, 180, 0.1); }
.colored-action { color: #7FFF00; background: rgba(127, 255, 0, 0.1); }
.colored-location { color: #FFA500; background: rgba(255, 165, 0, 0.1); }
.colored-aesthetic { color: #00FA9A; background: rgba(0, 250, 154, 0.1); }
.colored-camera { color: #00FFFF; background: rgba(0, 255, 255, 0.1); }
.colored-background { color: #FFA500; background: rgba(255, 165, 0, 0.1); }
.colored-decades { color: #FF6B6B; background: rgba(255, 107, 107, 0.1); }
.colored-color { color: #4ECDC4; background: rgba(78, 205, 196, 0.1); }
.colored-grain { color: #95E1D3; background: rgba(149, 225, 211, 0.1); }
.colored-skin { color: #F38181; background: rgba(243, 129, 129, 0.1); }
.colored-portrait { color: #AA96DA; background: rgba(170, 150, 218, 0.1); }

.prompt-block button {
    align-self: flex-end;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

body.dark .prompt-block button {
    color: #fff;
    text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.prompt-block button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);
}

/* === AI GENERATION SECTION === */
.ai-generation-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    padding: 30px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    margin-top: 20px;
}

.ai-header {
    text-align: center;
    margin-bottom: 25px;
}

.ai-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.ai-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: #667eea;
    margin-bottom: 8px;
}

.ai-header p {
    font-family: 'Rajdhani', sans-serif;
    color: #a0aec0;
    font-size: 1rem;
}

.ai-providers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.ai-provider {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.ai-provider:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(102, 126, 234, 0.5);
}

.provider-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.provider-icon {
    font-size: 1.5rem;
}

.provider-name {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #e2e8f0;
    flex: 1;
}

.provider-badge {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
    text-transform: uppercase;
}

.provider-desc {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 15px;
    flex: 1;
}

.generate-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.ideogram-btn { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.midjourney-btn { background: linear-gradient(135deg, #1a5f7a 0%, #159895 100%); }
.dalle-btn { background: linear-gradient(135deg, #10a37f 0%, #0d8c6d 100%); }
.imagefx-btn { background: linear-gradient(135deg, #4285f4 0%, #34a853 100%); }
.leonardo-btn { background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%); }
.seedream-btn { background: linear-gradient(135deg, #00d2ff 0%, #3a7bd5 100%); }

.generate-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* AI Preview */
.ai-preview {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    border: 1px solid rgba(102, 126, 234, 0.5);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    color: #667eea;
}

.close-preview {
    background: none;
    border: none;
    color: #e2e8f0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.preview-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #e2e8f0;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.preview-actions {
    display: flex;
    justify-content: flex-end;
}

.copy-go-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-go-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
}

/* === THEME TOGGLE === */
.theme-toggle {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    user-select: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: rgba(255, 255, 255, 0.2);
}

body.dark .theme-toggle {
    background: rgba(26, 31, 53, 0.8);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark .theme-toggle {
    color: #4a5568;
    text-shadow: 0 0 20px rgba(74, 85, 104, 0.5);
}

body.light .theme-toggle {
    color: #f6ad55;
    text-shadow: 0 0 20px rgba(246, 173, 85, 0.5);
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .container {
        margin: 20px;
        padding: 25px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .mode-buttons {
        grid-template-columns: 1fr;
    }
    
    .ai-providers {
        grid-template-columns: 1fr;
    }
    
    .prompt-block {
        flex-direction: column;
    }
    
    .prompt-block button {
        width: 100%;
        margin-top: 15px;
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-block {
    animation: fadeIn 0.5s ease forwards;
}

.category-block:nth-child(1) { animation-delay: 0.1s; }
.category-block:nth-child(2) { animation-delay: 0.2s; }
.category-block:nth-child(3) { animation-delay: 0.3s; }
.category-block:nth-child(4) { animation-delay: 0.4s; }
.category-block:nth-child(5) { animation-delay: 0.5s; }

/* Mode-specific grid adjustments */
.grid.portrait-mode .category-block:not(.portrait-module):not(.skin-module),
.grid.skin-mode .category-block:not(.skin-module),
.grid.decades-mode .category-block:not(.decades-module):not(.color-module):not(.grain-module):not(.camera-module):not(.bg-module) {
    opacity: 0.6;
    filter: grayscale(0.3);
}

.grid.portrait-mode .portrait-module,
.grid.portrait-mode .skin-module,
.grid.skin-mode .skin-module,
.grid.decades-mode .decades-module,
.grid.decades-mode .color-module,
.grid.decades-mode .grain-module,
.grid.decades-mode .camera-module,
.grid.decades-mode .bg-module {
    opacity: 1;
    filter: none;
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.3);
}