:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header Section */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
}

.main-nav a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.main-nav a.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    padding: 0.5rem 1rem;
    border-radius: 99px;
    font-size: 0.875rem;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* Main Grid */
.tool-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .tool-grid {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    textarea {
        height: 200px;
    }
    
    .upload-area {
        height: 200px;
    }
    
    .main-nav {
        gap: 1rem;
    }
    
    .main-nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .container {
        padding: 1rem;
    }
    
    .score-circle {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }
}

.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Input Styles */
textarea {
    width: 100%;
    height: 300px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1rem;
    color: var(--text-main);
    resize: none;
    font-size: 0.9rem;
}

textarea:focus {
    outline: 2px solid var(--primary);
    border-color: transparent;
}

.upload-area {
    height: 300px;
    border: 2px dashed var(--glass-border);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

/* Results Section */
.results-section {
    display: none;
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .results-grid { grid-template-columns: 1fr; }
}

.score-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(192, 132, 252, 0.1));
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    border: 6px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 3rem;
    font-weight: 800;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
}

.stats-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.stat-item { margin-bottom: 1rem; }
.stat-item:last-child { margin-bottom: 0; }

.stat-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Tooltip Styles */
.tooltip-icon {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 6px;
    font-size: 0.85rem;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.tooltip-icon:hover {
    opacity: 1;
}

.tooltip-text {
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 125%;
    background-color: rgba(30, 41, 59, 0.98);
    color: var(--text-main);
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    width: 280px;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.5;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(30, 41, 59, 0.98);
}

.tooltip-icon:hover .tooltip-text,
.tooltip-icon.active .tooltip-text {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Tooltip flips BELOW when icon is near top of screen */
.tooltip-icon.tooltip-below .tooltip-text {
    bottom: auto !important;
    top: 135% !important;
    transform: translateX(-50%) !important;
}

.tooltip-icon.tooltip-below .tooltip-text::after {
    top: -12px !important;
    bottom: auto !important;
    border-color: transparent transparent rgba(30, 41, 59, 0.98) transparent !important;
}

.progress-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #c084fc);
    transition: width 1.2s ease-out;
}

#tipsList {
    padding-left: 0;
    list-style: none;
}

#tipsList li {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

#tipsList li strong:first-child {
    display: block;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.analyze-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 1rem;
}

.analyze-btn:hover {
    background: var(--primary-hover);
}

.keyword-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 99px;
    font-size: 0.8rem;
    margin: 0.25rem;
    background: rgba(255,255,255,0.1);
}

.keyword-found { border: 1px solid var(--success); color: var(--success); }
.keyword-missing { border: 1px solid var(--danger); color: var(--danger); }

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    padding: 0.8rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* Ad Zones */
.ad-zone {
    margin: 2rem auto;
    text-align: center;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-top {
    margin-bottom: 2rem;
}

.ad-content {
    margin: 2rem auto;
}

.ad-bottom {
    margin-top: 3rem;
}

/* FAQ Section */
.faq-item {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.faq-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.faq-item h3 {
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.faq-item p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* Footer */
.site-footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary);
}

/* Legal Pages */
.legal-page {
    max-width: 800px;
    margin: 0 auto;
}

.legal-page h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.legal-page h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.legal-page p, .legal-page li {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.legal-page ul, .legal-page ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.legal-page a {
    color: var(--primary);
    text-decoration: none;
}

.legal-page a:hover {
    text-decoration: underline;
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--glass-border);
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 1000;
    animation: slideUp 0.4s ease;
}

.cookie-banner.hidden {
    display: none;
}

.cookie-banner p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.9rem;
}

.cookie-banner a {
    color: var(--primary);
    text-decoration: underline;
}

.cookie-banner button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.cookie-banner button:hover {
    background: var(--primary-hover);
}

@media (max-width: 768px) {
    .cookie-banner {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Mobile Tooltip Adjustments */
    .tooltip-text {
        width: 220px !important;
        font-size: 0.7rem !important;
        padding: 8px 10px !important;
        left: auto !important;
        right: -10px !important;
        transform: none !important;
        bottom: 110% !important;
    }
    
    .tooltip-text::after {
        left: auto !important;
        right: 15px !important;
        transform: none !important;
    }
    
    /* Make tooltips tap-friendly on mobile */
    .tooltip-icon {
        font-size: 1rem;
        padding: 4px;
    }
}

/* Loading State */
.btn-loader {
    display: inline-block;
    animation: pulse 1.5s ease-in-out infinite;
}

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

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

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