/* Global Styles */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --text-color: #f3f4f6;
    --text-muted: #94a3b8;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(12px);
    --radius-lg: 16px;
    --radius-md: 8px;
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-dark);
    color: var(--text-color);
    font-family: var(--font-body);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.logo,
.btn {
    font-family: var(--font-heading);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    gap: 8px;
    font-size: 1rem;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    width: 100%;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Navbar */
.navbar {
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a:not(.btn) {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-links a:not(.btn):hover,
.nav-links a.active {
    color: var(--text-color);
}

/* Hero Section */
.hero-section {
    padding: 80px 0 100px;
    text-align: center;
    background: #0f172a;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--card-border);
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

.hero-animation-bg {
    position: absolute;
    inset: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(at 0% 0%, #312e81 0px, transparent 50%),
        radial-gradient(at 100% 0%, #4338ca 0px, transparent 50%),
        radial-gradient(at 100% 100%, #1e1b4b 0px, transparent 50%),
        radial-gradient(at 0% 100%, #3730a3 0px, transparent 50%),
        radial-gradient(at 50% 50%, #0f172a 0px, transparent 50%);
    background-size: 100% 100%;
    filter: blur(60px);
    opacity: 0.6;
    animation: rotateMesh 20s linear infinite alternate;
    z-index: 1;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 1;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    pointer-events: none;
}

@keyframes rotateMesh {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(10deg) scale(1.1);
    }
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #ffffff 0%, #818cf8 25%, #c084fc 50%, #818cf8 75%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1.5px;
    line-height: 1.1;
    animation: textShimmer 6s linear infinite;
    position: relative;
    z-index: 2;
}

@keyframes textShimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.intro-text {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 40px;
    font-weight: 400;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 56px;
    flex-wrap: wrap;
    padding: 0;
}

.hero-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95rem;
}

.hero-features svg {
    color: var(--secondary-color);
}

/* Tool Interface */
.tool-wrapper {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 1. Upload View */
.upload-area {
    border: 2px dashed var(--card-border);
    border-radius: var(--radius-md);
    padding: 60px 20px;
    text-align: center;
    transition: 0.3s;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.upload-icon {
    margin-bottom: 24px;
    color: var(--text-muted);
    opacity: 0.7;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* 2. Tool Editor (File selected) */
.tool-editor {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    justify-content: center;
}

.file-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
}

.file-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-left: 12px;
    flex: 1;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
}

.file-size {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.pdf-controls {
    text-align: left;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

.input-dark {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-color);
    font-family: var(--font-body);
}

.input-dark:focus {
    outline: none;
    border-color: var(--primary-color);
}

.small-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 3. Result View */
.result-view {
    text-align: left;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.success-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--secondary-color);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.analysis-grid {
    display: grid;
    gap: 24px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Scrollbar for results */
.analysis-grid::-webkit-scrollbar {
    width: 6px;
}

.analysis-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.analysis-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

/* Result Cards */
.result-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header.summary {
    border-left: 3px solid var(--primary-color);
}

.card-header.dates {
    border-left: 3px solid #3b82f6;
}

.card-header.money {
    border-left: 3px solid var(--secondary-color);
}

.card-header.actions {
    border-left: 3px solid var(--warning-color);
}

.card-header.warnings {
    border-left: 3px solid var(--danger-color);
}

.card-content {
    padding: 16px;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.item-list li {
    margin-bottom: 10px;
    position: relative;
    padding-left: 20px;
}

.item-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--text-muted);
}

.item-list li:last-child {
    margin-bottom: 0;
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.6;
}

/* Loader */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    border-radius: var(--radius-lg);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Error Message */
.error-toast {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--danger-color);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    z-index: 50;
    animation: fadeUp 0.3s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translate(-50%, 10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* SEO Content Sections */
.seo-content {
    padding: 60px 0;
}

.content-block {
    margin-bottom: 60px;
}

.container-text {
    max-width: 900px;
}

.container-text h2 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: white;
}

.container-text p {
    color: #cbd5e1;
    margin-bottom: 20px;
    font-size: 1.05rem;
}

.highlight-text {
    color: var(--primary-color);
    font-weight: 600;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.step-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    text-align: center;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 16px;
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.use-case {
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    border-radius: var(--radius-md);
    border-left: 2px solid var(--primary-color);
}

.use-case h4 {
    color: white;
    margin-bottom: 8px;
}

/* FAQ */
.faq-section {
    margin-top: 60px;
}

.faq-grid {
    display: grid;
    gap: 20px;
}

.faq-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: 0.3s;
}

.faq-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-heading);
}

.faq-question::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: 0.3s;
}

.faq-card.active .faq-question::after {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    padding: 0 20px;
}

.faq-card.active .faq-answer {
    padding-bottom: 20px;
    max-height: 200px;
}

.faq-answer p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
}

/* --- Explore More Tools Grid --- */
.internal-links-block {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 1px solid var(--card-border);
}

.internal-links-block h3 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 1.5rem;
    color: white;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.tool-box-link {
    display: block;
    padding: 24px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: 0.3s;
    text-decoration: none;
}

.tool-box-link:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    background: linear-gradient(145deg, rgba(99, 102, 241, 0.1) 0%, rgba(255, 255, 255, 0.01) 100%);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.tool-box-link h4 {
    color: var(--text-color);
    margin-bottom: 8px;
    font-size: 1.15rem;
    display: block;
}

.tool-box-link span {
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: 500;
    display: block;
    margin-top: 8px;
}

/* Footer */
.main-footer {
    border-top: 1px solid var(--card-border);
    padding: 60px 0 20px;
    background: #020617;
    margin-top: 40px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    margin-bottom: 10px;
    display: block;
}

.brand-desc {
    color: var(--text-muted);
    max-width: 300px;
}

.footer-col h4 {
    color: white;
    margin-bottom: 16px;
}

.footer-col ul li {
    margin-bottom: 8px;
}

.footer-col ul li a {
    color: var(--text-muted);
}

.footer-col ul li a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--card-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }

    .tool-wrapper {
        padding: 20px;
        min-height: auto;
    }

    .upload-area {
        padding: 40px 10px;
    }

    .step-card {
        padding: 16px;
    }
}