/* 
   PDF TOOLS - EXPERT WEB TOOLS
   Theme: 2025 Glassmorphism (Responsive Fixed)
*/

/* --- Fonts & Root --- */
@font-face { font-family: 'Inter'; src: url('/fonts/inter-v20-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/fonts/orbitron-v35-latin-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Roboto Mono'; src: url('/fonts/roboto-mono-v31-latin-regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
    --bg-dark: #0a0a0f;
    --primary-accent: #3b82f6;
    --secondary-accent: #8b5cf6;
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --card-bg: rgba(25, 25, 35, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(255, 255, 255, 0.05);
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-code: 'Roboto Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    width: 100%;
    overflow-x: hidden; /* Prevents horizontal scrollbar */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.background-glow {
    position: fixed; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.08) 0%, rgba(10, 10, 15, 0) 50%);
    z-index: -1; pointer-events: none;
}

/* --- Header --- */
.tool-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.5rem 5%; 
    max-width: 1400px; 
    margin: 0 auto; 
    width: 100%;
}
.back-btn {
    color: var(--text-muted); text-decoration: none; display: flex; align-items: center; gap: 8px; transition: color 0.3s;
}
.back-btn:hover { color: var(--primary-accent); }
.logo { font-family: var(--font-heading); font-size: 1.2rem; }
.logo span { color: var(--primary-accent); }

/* --- Main Layout --- */
.main-content {
    flex-grow: 1; 
    padding: 2rem 5%; 
    max-width: 1200px; 
    margin: 0 auto; 
    width: 100%;
}

.tool-layout {
    display: grid; 
    grid-template-columns: 250px 1fr; 
    gap: 2rem; 
    align-items: start;
    width: 100%;
}

/* Sidebar Navigation */
.sidebar { display: flex; flex-direction: column; gap: 2rem; width: 100%; }
.nav-grid { display: flex; flex-direction: column; gap: 5px; }
.nav-label {
    font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 1px; margin: 15px 0 5px 10px;
}
.nav-btn {
    background: transparent; border: 1px solid transparent; color: var(--text-muted);
    padding: 12px 15px; border-radius: 8px; cursor: pointer; text-align: left;
    font-size: 0.95rem; transition: all 0.2s; display: flex; align-items: center; gap: 10px;
}
.nav-btn:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-btn.active {
    background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3);
    color: var(--primary-accent); font-weight: 600;
}
.nav-btn i { width: 20px; text-align: center; }

/* Tool Display Area */
.tool-display { min-height: 400px; width: 100%; }
.tool-pane { display: none; flex-direction: column; gap: 1.5rem; animation: fadeIn 0.3s ease; width: 100%; }
.tool-pane.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.pane-header h2 { font-family: var(--font-heading); font-size: 1.5rem; margin-bottom: 5px; line-height: 1.3; }
.pane-header p { color: var(--text-muted); font-size: 0.9rem; }

/* Drop Zone */
.drop-area {
    background: var(--card-bg); border: 2px dashed var(--card-border);
    border-radius: 16px; padding: 3rem 1rem; text-align: center;
    cursor: pointer; transition: all 0.2s;
    width: 100%;
}
.drop-area:hover, .drop-area.dragover { border-color: var(--primary-accent); background: rgba(59, 130, 246, 0.05); }
.upload-icon { font-size: 3rem; color: var(--secondary-accent); margin-bottom: 1rem; }
.drop-area h3 { font-family: var(--font-heading); font-size: 1.2rem; margin-bottom: 0.5rem; }

/* Settings Boxes */
.settings-box {
    background: rgba(0,0,0,0.2); border: 1px solid var(--card-border);
    padding: 1.5rem; border-radius: 12px; animation: slideDown 0.3s ease; width: 100%;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.settings-box label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 0.9rem; }
.settings-box input[type="text"] {
    width: 100%; background: var(--input-bg); border: 1px solid var(--card-border);
    color: #fff; padding: 10px; border-radius: 6px; outline: none; font-family: var(--font-body);
}
.settings-box input:focus { border-color: var(--primary-accent); }

/* Spacing for Metadata Form */
.form-group { margin-bottom: 15px; }
.hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 5px; }

/* Rotate Grid */
.rotate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rotate-opt {
    background: var(--input-bg); border: 1px solid var(--card-border);
    color: var(--text-muted); padding: 12px; border-radius: 8px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 5px; transition: all 0.2s;
}
.rotate-opt:hover { color: #fff; border-color: var(--primary-accent); }
.rotate-opt.selected { background: var(--primary-accent); color: #fff; border-color: var(--primary-accent); }

/* File List */
.file-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.file-list-item {
    background: rgba(0,0,0,0.3); border: 1px solid var(--card-border);
    padding: 12px 15px; border-radius: 8px; display: flex;
    justify-content: space-between; align-items: center; cursor: grab;
}
.file-name { color: #fff; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; overflow: hidden; }
.file-name i.fa-file-pdf { color: #ef4444; } 
.file-name i.fa-image { color: #8b5cf6; }    
.remove-file-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.2rem; }
.remove-file-btn:hover { color: #ef4444; }

/* Action Button */
.primary-btn {
    width: 100%; background: var(--primary-accent); color: #fff;
    border: none; padding: 14px; border-radius: 8px; font-weight: 600;
    cursor: pointer; font-size: 1rem; transition: background 0.2s; margin-top: 1rem;
}
.primary-btn:hover:not(:disabled) { background: #2563eb; }
.primary-btn:disabled { background: #475569; cursor: not-allowed; opacity: 0.7; }

/* Status & Spinner */
.status-box { text-align: center; min-height: 20px; font-size: 0.9rem; color: var(--text-muted); margin-top: 10px; }
.spinner {
    width: 24px; height: 24px; border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary-accent); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto 10px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Download Link */
.download-link {
    display: inline-block; margin-top: 10px; background: #10b981; color: #fff;
    padding: 8px 16px; border-radius: 6px; text-decoration: none; font-weight: 600;
}
.download-link:hover { background: #059669; }

/* Info Section */
.info-section { margin-top: 4rem; display: flex; justify-content: center; padding: 0 10px; }
.info-card {
    background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 1.5rem; border-radius: 12px; display: flex; align-items: flex-start; gap: 15px;
    color: #a7f3d0; max-width: 700px; width: 100%;
}
.info-card i { font-size: 1.5rem; margin-top: 3px; }
.info-card h3 { color: #fff; margin-bottom: 5px; font-family: var(--font-heading); font-size: 1rem; }

.hidden { display: none !important; }
footer { text-align: center; padding: 3rem 0; color: var(--text-muted); font-size: 0.9rem; border-top: 1px solid var(--card-border); margin-top: 3rem; }
footer a { color: #fff; text-decoration: none; }


/* =========================================
   MOBILE RESPONSIVENESS FIXES
   ========================================= */

/* Trigger for Tablets and Phones */
@media (max-width: 1024px) {
    .tool-layout {
        display: flex;
        flex-direction: column; /* Stack sidebar on top of tool */
        gap: 1.5rem;
    }

    /* NAVIGATION BUTTONS GRID (Stacking in multiple lines) */
    .sidebar { width: 100%; }
    .nav-label { display: none; } /* Hide labels to save space */
    
    .nav-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap; /* Allows buttons to wrap to next line */
        justify-content: space-between;
        gap: 10px;
    }

    .nav-btn {
        flex: 1 1 45%; /* Buttons take approx 50% width each */
        justify-content: center;
        text-align: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--card-border);
        white-space: nowrap;
    }
}

/* Trigger specifically for Phones */
@media (max-width: 600px) {
    .tool-header { 
        padding: 1rem 1rem; 
        flex-direction: column; 
        gap: 10px;
    }

    .main-content { padding: 1rem 1rem; }
    
    /* Ensure Nav buttons are readable on small screens */
    .nav-btn {
        flex: 1 1 45%; /* Keep 2 per row */
        font-size: 0.8rem;
        padding: 10px;
    }
    
    .logo { margin-bottom: 5px; }

    /* Fix Content Widths */
    .drop-area { padding: 2rem 1rem; }
    .upload-icon { font-size: 2rem; }
    
    /* Rotate Tool Grid: 1 column on very small screens, or tight 3 col */
    .rotate-grid { gap: 5px; }
    .rotate-opt { font-size: 0.75rem; padding: 8px; }

    /* Info Card Stacking */
    .info-card { flex-direction: column; text-align: center; align-items: center; }
}