:root {
    --bg-color: #0f172a;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary-accent: #3b82f6;
    --primary-hover: #2563eb;
    --success-accent: #10b981;
    --success-hover: #059669;
    --danger-accent: #ef4444;
    --danger-hover: #dc2626;
    --shape-1: #8b5cf6;
    --shape-2: #3b82f6;
    --shape-3: #ec4899;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 0;
}

/* Background Animated Shapes for Glassmorphism Effect */
.bg-shape {
    position: absolute;
    filter: blur(120px);
    z-index: -1;
    border-radius: 50%;
    animation: float 20s infinite alternate;
}

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

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--shape-2);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: var(--shape-3);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(100px, 100px) rotate(360deg); }
}

/* Main Layout */
.app-container {
    width: 90%;
    max-width: 1200px;
    min-height: 85vh;
    height: auto;
    display: flex;
    gap: 20px;
    z-index: 10;
    margin-bottom: 40px;
}

/* Footer */
.legal-footer {
    width: 100%;
    text-align: center;
    z-index: 10;
    margin-top: 20px;
}
.legal-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    margin: 0 15px;
    font-size: 14px;
    transition: color 0.3s;
}
.legal-footer a:hover {
    color: var(--primary-accent);
}

/* Glassmorphism Panel Base */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

/* Sidebar */
.sidebar {
    width: 250px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    color: #fff;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
}

.nav-btn.active {
    background: var(--primary-accent);
    color: #fff;
}

/* AdSense Slots */
.adsense-slot {
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    border-radius: 12px;
}
.adsense-sidebar { height: 250px; margin-top: auto; }
.adsense-banner { height: 90px; margin-bottom: 20px; width: 100%; }

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.tool-section {
    flex-grow: 1;
    padding: 40px;
    display: none;
    flex-direction: column;
    animation: fadeIn 0.4s ease forwards;
}

.tool-section.active {
    display: flex;
}

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

.tool-header h2 { font-size: 32px; margin-bottom: 10px; }
.tool-header p { color: var(--text-secondary); margin-bottom: 30px; }

/* Upload Area UI */
.upload-area {
    border: 2px dashed var(--glass-border);
    border-radius: 16px;
    padding: 50px;
    text-align: center;
    background: rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}
.upload-area:hover {
    border-color: var(--primary-accent);
    background: rgba(59, 130, 246, 0.05);
}
.upload-area i { font-size: 48px; margin-bottom: 15px; color: var(--primary-accent); }
.upload-area h3 { margin-bottom: 10px; }
.upload-area p { color: var(--text-secondary); margin-bottom: 20px; }

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.primary-btn { background: var(--primary-accent); color: white; }
.primary-btn:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(59,130,246,0.4); }
.success-btn { background: var(--success-accent); color: white; }
.success-btn:hover { background: var(--success-hover); transform: translateY(-2px); box-shadow: 0 4px 15px rgba(16,185,129,0.4); }
.danger-btn { background: var(--danger-accent); color: white; }
.danger-btn:hover { background: var(--danger-hover); transform: translateY(-2px); }
.secondary-btn { background: rgba(255,255,255,0.1); color: white; }
.secondary-btn:hover { background: rgba(255,255,255,0.2); }
.outline-btn { background: transparent; border: 1px solid var(--glass-border); color: var(--text-secondary); }
.outline-btn.active, .outline-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 20px; }
.icon-btn { background: transparent; border: none; color: white; font-size: 20px; cursor: pointer; transition: color 0.3s; }
.icon-btn:hover { color: var(--primary-accent); }

/* Utility Classes */
.hidden { display: none !important; }
.center-content { display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* Word to PDF Specific */
.preview-area { background: rgba(255,255,255,0.05); padding: 20px; border-radius: 12px; margin-top: 20px; max-height: 400px; overflow-y: auto; }
.document-preview { background: white; color: black; padding: 20px; border-radius: 4px; font-family: serif; min-height: 200px; margin-top: 10px;}

/* PDF Merger Specific */
.file-list { list-style: none; margin-top: 20px; }
.file-list li { background: rgba(255,255,255,0.05); padding: 15px; border-radius: 8px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; transition: all 0.2s ease; }
.file-list li.dragging { opacity: 0.4; background: rgba(255,255,255,0.1); border: 1px dashed var(--primary-accent); }

/* YT Thumbnail Specific */
.input-group { display: flex; gap: 10px; width: 100%; }
.input-group input { flex-grow: 1; padding: 15px; border-radius: 12px; border: 1px solid var(--glass-border); background: rgba(0,0,0,0.2); color: white; font-size: 16px; }
.input-group input:focus { outline: none; border-color: var(--primary-accent); }
.responsive-img { max-width: 100%; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }

/* Pomodoro Specific */
.timer-display { font-size: 120px; font-weight: 700; line-height: 1; margin-bottom: 30px; text-shadow: 0 0 20px rgba(255,255,255,0.2); font-variant-numeric: tabular-nums; }
.timer-controls { display: flex; gap: 15px; }
.timer-modes { display: flex; gap: 10px; background: rgba(0,0,0,0.2); padding: 5px; border-radius: 12px; }

/* Password Gen Specific */
.password-display-box { background: rgba(0,0,0,0.2); border: 1px solid var(--glass-border); padding: 30px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center; word-break: break-all; }
.password-display-box h2 { font-family: monospace; letter-spacing: 2px; }
.control-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.control-group input[type="range"] { width: 100%; cursor: pointer; accent-color: var(--primary-accent); }
.checkbox-group { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; }
.checkbox-group label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary-accent); }

/* Compare Box (Image Compress) */
.compare-container { display: flex; gap: 20px; width: 100%; }
.compare-box { flex: 1; background: rgba(0,0,0,0.2); padding: 20px; border-radius: 12px; text-align: center; }
.compare-box h5 { color: var(--text-secondary); margin-bottom: 10px; }
.compare-box p { font-size: 24px; font-weight: 600; }
.text-success { color: var(--success-accent); }
.text-primary { color: var(--primary-accent); }

/* Responsive Design */
@media (max-width: 900px) {
    body {
        padding: 15px 0;
    }
    
    .app-container { 
        flex-direction: column; 
        height: auto; 
        min-height: auto; 
        padding: 0; 
        width: 95%;
        gap: 10px;
        margin-bottom: 20px;
    }
    
    /* Sidebar becomes a compact horizontal nav bar */
    .sidebar { 
        width: 100%; 
        padding: 15px; 
        border-radius: 16px;
        flex-direction: column;
        gap: 10px;
    }
    
    .logo { 
        margin-bottom: 0; 
        width: 100%; 
        justify-content: center; 
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .nav-menu { 
        flex-direction: row; 
        flex-wrap: wrap; 
        justify-content: center; 
        gap: 6px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 13px;
        border-radius: 10px;
        gap: 6px;
    }
    
    .nav-btn i {
        font-size: 12px;
    }
    
    /* Main content area improvements */
    .main-content {
        padding: 0;
    }
    
    .glass-panel {
        border-radius: 16px;
    }
    
    .tool-section {
        padding: 20px 15px;
    }
    
    .tool-header h2 {
        font-size: 24px;
    }
    
    .tool-header p {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    /* Upload area compact */
    .upload-area {
        padding: 30px 20px;
        border-radius: 12px;
    }
    
    .upload-area i {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .upload-area h3 {
        font-size: 16px;
    }
    
    /* Hide sidebar ad on mobile */
    .adsense-sidebar { display: none; }
    
    /* Timer responsive */
    .timer-display { font-size: 70px; }
    .timer-controls { flex-wrap: wrap; justify-content: center; }
    .timer-modes { flex-wrap: wrap; justify-content: center; }
    
    /* Password generator responsive */
    .checkbox-group { grid-template-columns: 1fr; }
    .password-display-box { padding: 20px; }
    .password-display-box h2 { font-size: 18px; }
    
    /* Compare boxes stack on mobile */
    .compare-container { flex-direction: column; }
    
    /* Input group stack */
    .input-group { flex-direction: column; }
    
    /* Footer */
    .legal-footer a { margin: 0 8px; font-size: 13px; }
}

@media (max-width: 400px) {
    .nav-btn {
        padding: 7px 10px;
        font-size: 12px;
    }
    
    .tool-header h2 {
        font-size: 20px;
    }
    
    .timer-display { font-size: 55px; }
    
    .logo {
        font-size: 18px;
    }
}
