:root {
    --bg-color: #0a0e17;
    --panel-bg: rgba(16, 24, 40, 0.6);
    --panel-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-glow: #3b82f6;
    --accent-glow-2: #8b5cf6;
    --btn-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --btn-hover: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    --glass-blur: blur(16px);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Background Gradients */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 10s infinite ease-in-out alternate;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
}

.glow-2 {
    bottom: -10%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, var(--accent-glow-2) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

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

.logo i {
    color: #60a5fa;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

header h1 {
    font-weight: 700;
}

header h1 span {
    font-weight: 300;
    color: var(--text-secondary);
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Input Section */
.input-section {
    text-align: center;
    margin-bottom: 3rem;
    transition: transform 0.3s ease;
}

.input-section h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.input-section p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-group i.fa-link {
    color: var(--text-secondary);
    padding: 0 1rem;
}

input[type="url"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    padding: 0.8rem 0;
}

input[type="url"]::placeholder {
    color: #475569;
}

button {
    background: var(--btn-primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--btn-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--panel-border);
    font-size: 0.9rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

/* Loading State */
#loadingSection {
    text-align: center;
    padding: 4rem 0;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    color: #60a5fa;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Results Section */
.hidden {
    display: none !important;
}

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

.report-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.badge {
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Report Cards */
.audit-card {
    background: var(--panel-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease;
    animation: fadeUp 0.5s ease backwards;
}

.audit-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.2);
}

.card-header i {
    font-size: 1.2rem;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-body li {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.card-body li i {
    margin-top: 0.25rem;
    font-size: 1.1rem;
}

.card-body li.issue i { color: var(--danger); }
.card-body li.warning i { color: var(--warning); }
.card-body li.good i { color: var(--success); }
.card-body li.info i { color: #60a5fa; }

.detail-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.detail-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.detail-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.fix-box {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
}

.fix-box strong {
    color: #60a5fa;
    display: block;
    margin-bottom: 0.25rem;
}

/* API Key Section Premium Design */
.api-key-wrapper {
    margin: 2rem auto 0;
    display: flex;
    align-items: center;
    max-width: 650px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.8rem 1.2rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    gap: 1rem;
}

.api-key-wrapper:focus-within {
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.3), 0 0 0 1px rgba(96, 165, 250, 0.5);
}

.api-key-wrapper i.fa-key {
    color: #60a5fa;
    font-size: 1.1rem;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.6rem;
    border-radius: 10px;
}

.api-key-wrapper input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    letter-spacing: 1px;
}

.api-key-wrapper input::placeholder {
    color: #475569;
    letter-spacing: normal;
}

/* Divider */
.api-divider {
    width: 2px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 0.5rem;
    border-radius: 2px;
}

.model-select {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    outline: none;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2394a3b8%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2rem;
}

.model-select:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.model-select option {
    background: #0f172a;
    color: #e2e8f0;
}

.btn-small {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    padding: 0.55rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-small:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px -3px rgba(59, 130, 246, 0.3);
    color: #fff;
}

/* New Saved State */
.btn-small.saved {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.1);
}

.btn-small.saved:hover {
    background: rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .report-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .input-group {
        flex-direction: column;
        background: transparent;
        border: none;
    }
    .input-group i.fa-link { display: none; }
    input[type="url"] {
        width: 100%;
        background: rgba(0,0,0,0.3);
        border: 1px solid var(--panel-border);
        border-radius: 12px;
        padding: 1rem;
        margin-bottom: 1rem;
    }
    button { width: 100%; justify-content: center; }
}
