@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

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

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a0b2e 50%, #16213e 100%);
    color: #ffffff;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(90deg, #4C1F7A 0%, #B83DBA 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00FFFF;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.1) 2px,
        rgba(0, 255, 255, 0.1) 4px
    );
    pointer-events: none;
}

.app-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-shadow: 
        0 0 10px #00FFFF,
        2px 0 0 #ff0000,
        -2px 0 0 #00ff00;
    animation: chromatic-pulse 3s ease-in-out infinite;
}

.ai-bot-avatar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bot-icon {
    font-size: 2rem;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 10px #00FFFF);
}

.bot-status-indicator {
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #00FFFF, #00ff00);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

@keyframes chromatic-pulse {
    0%, 100% { 
        text-shadow: 0 0 10px #00FFFF, 2px 0 0 #ff0000, -2px 0 0 #00ff00; 
    }
    50% { 
        text-shadow: 0 0 20px #B83DBA, 3px 0 0 #ff0000, -3px 0 0 #00ff00; 
    }
}

.nav-tabs {
    display: flex;
    gap: 1rem;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00FFFF;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.tab-btn:hover,
.tab-btn.active {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.main-content {
    display: flex;
    flex: 1;
    gap: 1rem;
    padding: 1rem;
    position: relative;
}

.ai-chat-panel {
    position: fixed;
    top: 120px;
    right: 20px;
    width: 300px;
    max-height: 400px;
    background: rgba(0, 255, 255, 0.05);
    border: 2px solid #00FFFF;
    border-radius: 15px;
    backdrop-filter: blur(15px);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
}

.ai-chat-panel.collapsed .chat-messages,
.ai-chat-panel.collapsed .chat-input-area {
    display: none;
}

.ai-chat-panel.collapsed {
    max-height: 60px;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 13px 13px 0 0;
}

.chat-header h3 {
    color: #00FFFF;
    font-size: 1.1rem;
    text-shadow: 0 0 10px currentColor;
}

.chat-toggle {
    background: none;
    border: 1px solid #00FFFF;
    color: #00FFFF;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    max-height: 250px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.bot-message {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.bot-avatar {
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px #00FFFF);
}

.message-content {
    background: rgba(0, 255, 255, 0.1);
    padding: 0.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    flex: 1;
    border: 1px solid rgba(0, 255, 255, 0.2);
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
}

.magic-button {
    width: 100%;
    background: linear-gradient(45deg, #B83DBA, #00FFFF);
    border: none;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.magic-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 255, 0.4);
}

.sidebar-left,
.sidebar-right {
    width: 280px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 10px;
    padding: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    height: fit-content;
}

.sidebar-left h3,
.sidebar-right h3 {
    color: #00FFFF;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-shadow: 0 0 10px currentColor;
}

.preset-grid {
    display: grid;
    gap: 0.5rem;
}

.preset-btn {
    background: linear-gradient(45deg, #4C1F7A, #B83DBA);
    border: 1px solid #00FFFF;
    color: #ffffff;
    padding: 0.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.preset-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.preset-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.preset-btn:hover::before {
    left: 100%;
}

.preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.3);
}

.bot-section {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
}

.bot-section h4 {
    color: #00FFFF;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bot-section h4::before {
    content: '🤖';
}

.bot-preset-grid {
    display: grid;
    gap: 0.5rem;
}

.bot-preset-btn {
    background: linear-gradient(45deg, #00FFFF, #B83DBA);
    border: 1px solid #ffffff;
    color: #ffffff;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    text-align: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.bot-preset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 255, 255, 0.4);
}

.canvas-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-zone {
    width: 100%;
    max-width: 800px;
    height: 400px;
    border: 3px dashed #00FFFF;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 10px #00FFFF);
}

.upload-zone p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.upload-subtitle {
    font-size: 1rem !important;
    color: #00FFFF;
    font-style: italic;
}

.upload-zone:hover,
.upload-zone.drag-hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    animation: glitch-border 0.5s ease;
}

@keyframes glitch-border {
    0%, 100% { border-color: #00FFFF; }
    25% { border-color: #ff0080; }
    50% { border-color: #00ff80; }
    75% { border-color: #8000ff; }
}

#main-canvas {
    border: 2px solid #00FFFF;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    display: none;
    max-width: 100%;
    height: auto;
}

.canvas-controls {
    display: flex;
    gap: 1rem;
}

.ai-guidance-panel {
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.ai-suggestion {
    color: #00FFFF;
    font-size: 0.9rem;
    text-align: center;
}

.ai-tip {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.control-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #00FFFF;
    font-size: 0.9rem;
    text-shadow: 0 0 5px currentColor;
}

.slider-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider {
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #1a0b2e, #4C1F7A);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    flex: 1;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #00FFFF, #B83DBA);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
}

.ai-range-indicator {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.ai-range-indicator.optimal {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.3);
}

.ai-range-indicator.good {
    background: rgba(255, 255, 0, 0.2);
    border-color: #ffff00;
    color: #ffff00;
}

.ai-enhance-btn {
    width: 100%;
    background: linear-gradient(45deg, #00FFFF, #B83DBA);
    border: none;
    color: #ffffff;
    padding: 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    margin-top: 1rem;
}

.ai-enhance-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 255, 255, 0.4);
}

.bottom-toolbar {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.tool-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid #00FFFF;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.tool-btn.primary {
    background: linear-gradient(45deg, #B83DBA, #00FFFF);
    border-color: #ffffff;
}

.tool-btn.ai-btn {
    background: linear-gradient(45deg, #00FFFF, #B83DBA);
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.tool-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 255, 255, 0.3);
}

.tool-btn:active {
    transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 1400px) {
    .ai-chat-panel {
        position: relative;
        top: auto;
        right: auto;
        width: 100%;
        order: -1;
        margin-bottom: 1rem;
    }
}

@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .sidebar-left,
    .sidebar-right {
        width: 100%;
        max-width: 800px;
        margin: 0 auto;
    }
    
    .preset-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .app-title {
        font-size: 1.8rem;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .bottom-toolbar {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .preset-grid {
        grid-template-columns: 1fr;
    }
    
    .canvas-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .ai-chat-panel {
        width: calc(100vw - 40px);
        left: 20px;
        right: 20px;
    }
}

/* Scanline overlay for retro feel */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.03) 2px,
        rgba(0, 255, 255, 0.03) 4px
    );
    pointer-events: none;
    z-index: 999;
}

/* Glow animations */
@keyframes glow {
    0%, 100% { 
        filter: drop-shadow(0 0 5px currentColor);
    }
    50% { 
        filter: drop-shadow(0 0 20px currentColor);
    }
}

.control-group label {
    animation: glow 2s ease-in-out infinite;
}

/* Custom scrollbar for chat */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 255, 0.3);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 255, 0.5);
}