/* --- CSS Variables & Design System --- */
:root {
    /* Colors */
    --bg-dark: #0a0a0f;
    --bg-darker: #050508;
    --text-main: #ffffff;
    --text-muted: #a0a0b0;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-secondary: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    --gradient-accent: linear-gradient(135deg, #ec4899 0%, #f43f5e 100%);
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Neons */
    --neon-blue: 0 0 10px rgba(99, 102, 241, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
    --neon-purple: 0 0 10px rgba(168, 85, 247, 0.5), 0 0 20px rgba(168, 85, 247, 0.3);
    
    /* Layout */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Reset --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Cairo', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* --- Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.section-padding {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.hidden {
    display: none !important;
}

/* --- Animated Background Shapes --- */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: float 20s infinite alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-primary);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-secondary);
    bottom: 10%;
    left: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: var(--gradient-accent);
    top: 40%;
    right: 20%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -50px) scale(1.1); }
}

/* --- Glassmorphism Cards --- */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

/* --- Header & Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    padding: 20px 0;
}

.navbar.scrolled {
    padding: 15px 0;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover {
    color: #a855f7;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero {
    padding: 180px 0 100px;
    text-align: center;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

#searchInput {
    width: 100%;
    padding: 20px 50px 20px 20px;
    border-radius: 50px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#searchInput:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: var(--neon-blue);
    background: rgba(255, 255, 255, 0.08);
}

/* --- Statistics Section --- */
.stats {
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.02), transparent);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.stat-card {
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
}

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

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* --- Tools Grid --- */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

.most-used-grid {
    grid-template-columns: repeat(3, 1fr);
}

.tool-card {
    padding: 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.tool-card > * {
    position: relative;
    z-index: 1;
}

.tool-card:hover {
    transform: translateY(-10px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--neon-blue);
}

.tool-card:hover::before {
    opacity: 0.05;
}

.card-icon {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 20px;
    color: #fff;
    transition: var(--transition);
}

.highlight-card .card-icon {
    background: var(--gradient-primary);
    box-shadow: var(--neon-purple);
}

.highlight-card .gradient-2 { background: var(--gradient-secondary); box-shadow: 0 0 15px rgba(45, 212, 191, 0.4); }
.highlight-card .gradient-3 { background: var(--gradient-accent); box-shadow: 0 0 15px rgba(236, 72, 153, 0.4); }

.tool-card:hover .card-icon {
    transform: scale(1.1);
    background: var(--gradient-primary);
    box-shadow: var(--neon-purple);
}

.tool-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.tool-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-tool {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
}

.tool-card:hover .btn-tool {
    background: var(--gradient-primary);
    border-color: transparent;
}

/* --- FAQ Section --- */
.faq-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    padding: 20px 25px;
    cursor: pointer;
    transition: var(--transition);
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-question h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.faq-question i {
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
    color: #a855f7;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.faq-item.active .faq-answer {
    max-height: 200px;
}

.faq-answer p {
    padding-top: 15px;
    color: var(--text-muted);
}

/* --- Footer --- */
.footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--glass-border);
    padding: 60px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 15px;
    max-width: 300px;
}

.footer-links h3, .footer-social h3 {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links ul li a:hover {
    color: var(--text-main);
    padding-right: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    width: 40px;
    height: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    text-decoration: none;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--gradient-primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* --- Modal (Image Compressor Demo) --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    transform: translateY(20px) scale(0.95);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0) scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    left: 20px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.modal-header p {
    color: var(--text-muted);
}

.upload-area {
    border: 2px dashed rgba(99, 102, 241, 0.5);
    border-radius: var(--radius-md);
    padding: 50px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(99, 102, 241, 0.05);
}

.upload-area:hover, .upload-area.dragover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #a855f7;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #6366f1;
}

.compressor-workspace {
    animation: fadeIn 0.5s ease;
}

.image-preview-container {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.image-preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.compression-controls {
    background: rgba(255,255,255,0.02);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
}

.quality-slider-container {
    margin-bottom: 20px;
}

.quality-slider-container label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #333;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gradient-primary);
    cursor: pointer;
}

.size-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.size-box {
    text-align: center;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: var(--radius-sm);
    flex: 1;
}

.size-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.size-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.exchange-icon {
    margin: 0 15px;
    color: var(--text-muted);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    box-shadow: var(--neon-purple);
    transform: translateY(-2px);
}

.w-100 {
    width: 100%;
}

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

/* --- Toast Notification --- */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(45, 212, 191, 0.3);
    padding: 15px 30px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: bottom 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 9999;
}

.toast.show {
    bottom: 30px;
}

.toast i {
    color: #2dd4bf;
    font-size: 1.2rem;
}

.no-results {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* --- Dynamic Modal Tools CSS --- */
.form-group {
    margin-bottom: 20px;
    text-align: right;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.checkbox-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.checkbox-label input {
    accent-color: #a855f7;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.password-result {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border: 1px dashed var(--glass-border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 1.5rem;
    letter-spacing: 2px;
    word-break: break-all;
    font-family: monospace;
    color: #2dd4bf;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-result {
    margin-top: 20px;
    text-align: center;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 20px;
}

.qr-result img {
    max-width: 200px;
    height: auto;
}

.progress-container {
    margin-top: 30px;
    display: none;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.2s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.simulation-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #a855f7;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
    100% { transform: scale(1); opacity: 1; }
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .stats-grid, .most-used-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hamburger {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: var(--bg-darker);
        flex-direction: column;
        align-items: center;
        padding-top: 50px;
        transition: var(--transition);
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .stats-grid, .most-used-grid, .footer-content {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 20px;
    }
}
