@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 50%, rgba(56, 189, 248, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Container */

.container {
    max-width: 1200px;
    margin: auto;
    position: relative;
    z-index: 1;
}

/* Header with Logo */

.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Title */

h1 {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 48px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -1px;
    text-shadow: 0 0 40px rgba(56, 189, 248, 0.3);
}

.header p {
    color: #94a3b8;
    font-size: 16px;
    margin-top: 10px;
    font-weight: 400;
}

/* Input Section */

.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Textarea */

textarea {
    width: 100%;
    min-height: 280px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid #334155;
    border-radius: 16px;
    padding: 24px;
    color: white;
    font-size: 15px;
    font-family: 'JetBrains Mono', monospace;
    resize: vertical;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

textarea:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.1), 0 8px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

textarea::placeholder {
    color: #64748b;
}

/* Button */

button {
    padding: 18px 32px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: white;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
    position: relative;
    overflow: hidden;
}

button::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;
}

button:hover::before {
    left: 100%;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(56, 189, 248, 0.4);
}

button:active {
    transform: translateY(0);
}

/* Loading */

.loading {
    margin-top: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Spinner */

.spinner {
    width: 30px;
    height: 30px;
    border: 4px solid #334155;
    border-top: 4px solid #38bdf8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.loading p {
    color: #94a3b8;
    font-weight: 500;
}

/* Error Box */

.error-box {
    margin-top: 20px;
    padding: 18px 24px;
    background: rgba(127, 29, 29, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid #ef4444;
    border-radius: 12px;
    color: #fecaca;
    font-weight: 600;
    animation: shake 0.5s ease;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Panels */

.panels {
    margin-top: 50px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Panel Card */

.panel {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid #334155;
    border-radius: 20px;
    padding: 28px;
    min-height: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #38bdf8, #0ea5e9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.panel:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
    box-shadow: 0 12px 40px rgba(56, 189, 248, 0.2);
}

.panel:hover::before {
    opacity: 1;
}

/* Panel Title */

.panel h2 {
    margin-bottom: 20px;
    color: #38bdf8;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel h2::before {
    content: '●';
    font-size: 12px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Issues List */

#issuesOutput {
    padding-left: 20px;
    line-height: 2;
    color: #e2e8f0;
}

#issuesOutput li {
    margin-bottom: 10px;
    position: relative;
}

#issuesOutput li::marker {
    color: #38bdf8;
}

#explanationOutput {
    color: #cbd5e1;
    line-height: 1.8;
    font-size: 15px;
}

/* Code Output */

pre {
    white-space: pre-wrap;
    overflow-x: auto;
    color: #4ade80;
    font-size: 14px;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(15, 23, 42, 0.6);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #334155;
    line-height: 1.6;
}

/* Hidden */

.hidden {
    display: none;
}

/* Responsive */

@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

    h1 {
        font-size: 36px;
    }

    .header {
        margin-bottom: 30px;
    }

    textarea {
        min-height: 220px;
        font-size: 14px;
    }

    .panels {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    button {
        padding: 16px 24px;
        font-size: 16px;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: rgba(56, 189, 248, 0.3);
    color: white;
}

/* Ask Question Section */
.ask-question-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #334155;
}

.question-divider {
    text-align: center;
    margin-bottom: 16px;
}

.question-divider span {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    background: rgba(30, 41, 59, 0.8);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #334155;
}

.question-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.question-input {
    flex: 1;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 2px solid #334155;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.question-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.question-input::placeholder {
    color: #64748b;
}

.btn-ask {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-ask:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-ask:active {
    transform: translateY(0);
}

.answer-output {
    padding: 16px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid #8b5cf6;
    border-radius: 12px;
    color: #e9d5ff;
    line-height: 1.7;
    animation: fadeIn 0.3s ease;
    margin-top: 12px;
}

.answer-output::before {
    content: '💡 ';
    font-size: 16px;
}


/* Action Buttons Section */
.action-buttons {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.5s ease-out;
}

/* Success notification */
.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    background: rgba(34, 197, 94, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(34, 197, 94, 0.3);
    animation: slideInRight 0.3s ease-out;
    z-index: 1000;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
