/* Main Stylesheet for KyaToolsJi (Premium Version) */
:root {
    /* Theme Variables */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #3b82f6;
    --accent: #f59e0b;

    --bg-dark: #0f172a;
    --bg-card: #1e293b;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.7);

    --success: #10b981;
    --font-main: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    padding: 15px 0;
    /* Reduced padding */
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    color: white;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
}

/* Hero Section (FIX 1: Reduced Spacing) */
.hero-section {
    padding: 40px 0 60px;
    /* Reduced top padding from 100px to 40px */
    text-align: center;
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle at top center, #1e3a8a 0%, var(--bg-dark) 60%);
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.highlight {
    background: linear-gradient(120deg, #60a5fa, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.intro-text p {
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 10px;
    font-size: 1.1rem;
    font-weight: 300;
}

/* Benefit List */
.benefit-list {
    display: flex;
    justify-content: center;
    gap: 15px;
    list-style: none;
    margin: 25px 0 40px;
    /* Compact margin */
    flex-wrap: wrap;
}

.benefit-list li {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 8px 20px;
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

/* Tool Wrapper */
.crop-tool-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    min-height: 400px;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 12px;
    padding: 60px 20px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

.icon-upload {
    color: var(--primary);
    margin-bottom: 20px;
}

.upload-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.upload-content p {
    color: var(--text-muted);
}

/* Settings Grid */
.tool-settings {
    text-align: left;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.settings-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

/* Range Slider for Tolerance */
.range-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-slider {
    flex-grow: 1;
    height: 6px;
    background: var(--glass-border);
    border-radius: 5px;
    appearance: none;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: 0.2s;
}

.range-value {
    color: white;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    outline: none;
}

/* Buttons */
.primary-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.primary-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 12px 25px;
    border-radius: 10px;
    cursor: pointer;
    margin-left: 10px;
}

.secondary-btn:hover {
    border-color: white;
    color: white;
}

/* FAQ Styling (FIX 4: Engaging FAQs) */
.faq-section {
    padding-top: 40px;
}

.faq-item {
    margin-bottom: 15px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
    transition: all 0.3s;
}

.faq-item:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.faq-item summary {
    padding: 20px;
    cursor: pointer;
    font-weight: 600;
    color: white;
    list-style: none;
    /* Hide default triangle */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 300;
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    padding: 0 20px 20px;
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0;
    border-top: 1px solid transparent;
    /* Smoother transition placeholder */
}

/* Result View */
.result-preview-container {
    background-image:
        linear-gradient(45deg, #2b3544 25%, transparent 25%),
        linear-gradient(-45deg, #2b3544 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #2b3544 75%),
        linear-gradient(-45deg, transparent 75%, #2b3544 75%);
    background-size: 20px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    margin-bottom: 20px;
}

.result-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.hidden {
    display: none !important;
}

/* Loader */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 50;
    border-radius: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.main-footer {
    border-top: 1px solid var(--glass-border);
    padding: 60px 0 30px;
    background: #020617;
    margin-top: 80px;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
}

.footer-col ul {
    list-style: none;
}

.footer-col a {
    color: #64748b;
    text-decoration: none;
}

.footer-col a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 40px;
    color: #475569;
}

/* Mobile */
@media (max-width: 768px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }
}