/* Design System for Grand Tool Box */

/* Theme Variables */
:root {
    color-scheme: dark;
    /* Dark Mode Defaults - Upgraded for iOS 26 Glassmorphism */
    --bg-base: #070913;
    --bg-surface: rgba(18, 24, 38, 0.45);
    --bg-surface-solid: #121826;
    --bg-glass: rgba(10, 13, 22, 0.55);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.25);
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    
    --accent: #ec4899;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius-sm: 8px;
    --border-radius-md: 14px;
    --border-radius-lg: 20px;
}

[data-theme="light"] {
    color-scheme: light;
    --bg-base: #f0f2f6;
    --bg-surface: rgba(255, 255, 255, 0.45);
    --bg-surface-solid: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.65);
    --border-color: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.14);
    
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #4f46e5;
    --primary-hover: #3730a3;
    --primary-glow: rgba(79, 70, 229, 0.15);
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #8b5cf6 100%);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
}

/* Reset & Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.05) 50%, transparent 100%);
    z-index: -2;
    pointer-events: none;
    filter: blur(80px);
    animation: floatGlow1 20s ease-in-out infinite alternate;
}

body::after {
    content: '';
    position: fixed;
    bottom: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.12) 0%, rgba(99, 102, 241, 0.03) 60%, transparent 100%);
    z-index: -2;
    pointer-events: none;
    filter: blur(80px);
    animation: floatGlow2 25s ease-in-out infinite alternate;
}

@keyframes floatGlow1 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, 10%) scale(1.1); }
}

@keyframes floatGlow2 {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-10%, -5%) scale(1.15); }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styling */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-glass);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.logo-badge {
    background: var(--primary-glow);
    color: var(--primary);
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    text-transform: uppercase;
}

.sidebar-close-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.sidebar-nav {
    flex: 1;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.nav-item i {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item:hover i {
    transform: scale(1.05);
}

.nav-item.active {
    color: white;
    background: var(--primary-gradient);
    box-shadow: 0 4px 15px var(--primary-glow);
}

[data-theme="light"] .nav-item.active {
    color: white;
}

.nav-separator {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin: 20px 16px 8px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

.privacy-note i {
    width: 16px;
    height: 16px;
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

/* Header Styling */
.app-header {
    height: var(--header-height);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-logo-mobile {
    display: none;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.menu-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

.search-container {
    position: relative;
    width: 100%;
    max-width: 480px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

#search-input {
    width: 100%;
    height: 42px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0 16px 0 48px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

#search-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.clear-search-btn {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
}

.theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* Dashboard Content Pane */
.dashboard-pane {
    padding: 40px;
    flex: 1;
}

.dashboard-hero {
    margin-bottom: 40px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid var(--border-color);
    padding: 48px;
    border-radius: var(--border-radius-lg);
    position: relative;
    overflow: hidden;
}

.dashboard-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.dashboard-hero h1 {
    font-family: var(--font-heading);
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    z-index: 1;
}

.dashboard-hero p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 600px;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* Category Headers */
.section-title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.tool-count-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
}

/* Tools Grid Layout */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Tool Card styling */
.tool-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-md);
    padding: 1px;
    background: linear-gradient(135deg, transparent 70%, var(--primary) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.tool-card:hover::after {
    opacity: 1;
}

.tool-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-glow);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon-wrapper {
    transform: scale(1.08) rotate(2deg);
}

.tool-icon-wrapper i {
    width: 24px;
    height: 24px;
}

.tool-info h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.tool-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.tool-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.tool-badge.pdf { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.tool-badge.image { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.tool-badge.video { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.tool-badge.calc { background: rgba(99, 102, 241, 0.1); color: #6366f1; }
.tool-badge.resume { background: rgba(236, 72, 153, 0.1); color: #ec4899; }
.tool-badge.other { background: rgba(107, 114, 128, 0.1); color: #9ca3af; }

/* Workspace Area */
.workspace-pane {
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.workspace-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 24px;
}

.back-btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.back-btn i {
    width: 16px;
    height: 16px;
}

.active-tool-title-area h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 6px;
}

.active-tool-title-area p {
    color: var(--text-secondary);
    font-size: 14px;
}

.workspace-body {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
    min-height: 400px;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

/* ==========================================================================
   Common Tool Components (Forms, Inputs, Drag-and-drop, Canvas, Sliders)
   ========================================================================== */

/* File Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 48px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.drop-zone:hover, .drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.drop-zone-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.drop-zone-icon i {
    width: 32px;
    height: 32px;
}

.drop-zone p {
    font-size: 14px;
    color: var(--text-secondary);
}

.drop-zone p span {
    color: var(--primary);
    font-weight: 600;
}

.drop-zone-file-info {
    display: none;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 10px 16px;
    margin-top: 10px;
}

.drop-zone-file-info span {
    font-size: 13px;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--primary-glow);
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--primary-glow);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
    box-shadow: none;
}

.btn-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Forms and Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    height: 44px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

textarea.form-control {
    height: 120px;
    padding: 12px 16px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 44px;
}

select.form-control option,
select.form-control optgroup {
    background: var(--bg-surface-solid);
    color: var(--text-primary);
}

[data-theme="light"] select.form-control option,
[data-theme="light"] select.form-control optgroup {
    background: #ffffff;
    color: #0f172a;
}

/* Sliders */
.range-slider {
    display: flex;
    align-items: center;
    gap: 16px;
}

.range-slider input[type="range"] {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.range-slider input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-val {
    min-width: 45px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
}

/* Progress & Loading States */
.processing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.05);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar-container {
    width: 100%;
    max-width: 320px;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.3s ease;
}

/* Results Section */
.results-card {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.01);
    padding: 24px;
    margin-top: 24px;
}

.results-card h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Interactive Charts / Layout split */
.layout-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 900px) {
    .layout-split {
        grid-template-columns: 1fr;
    }
}

.chart-wrapper {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 250px;
}

/* Tables styling */
.table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle-btn {
        display: block;
    }
    .sidebar-close-btn {
        display: block;
    }
    .header-logo-mobile {
        display: flex !important;
        align-items: center;
        gap: 8px;
    }
}

@media (max-width: 640px) {
    .app-header {
        padding: 0 16px;
    }
    .header-logo-mobile .logo-text {
        display: none !important;
    }
    .dashboard-pane {
        padding: 20px;
    }
    .workspace-pane {
        padding: 20px;
    }
    .workspace-body {
        padding: 20px;
    }
    .dashboard-hero {
        padding: 24px;
        margin-bottom: 24px;
    }
    .dashboard-hero h1 {
        font-size: 28px;
    }
}

/* Fullscreen Book Reader Layout */
.app-container.fullscreen-tool .app-sidebar {
    display: none;
}
.app-container.fullscreen-tool .main-content {
    margin-left: 0 !important;
}
.app-container.fullscreen-tool .app-header {
    display: none;
}
.app-container.fullscreen-tool .workspace-pane {
    padding: 0 !important;
    height: 100vh;
}
.app-container.fullscreen-tool .workspace-body {
    padding: 0 !important;
    height: 100vh;
}
.app-container.fullscreen-tool .book-reader-tool {
    height: 100vh !important;
    min-height: 100vh !important;
    gap: 0 !important;
}

/* Premium Full Picture Cover Card styling */
.book-card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-md) !important;
    padding: 0 !important;
    box-shadow: var(--shadow-sm) !important;
    display: flex;
    flex-direction: column;
    gap: 0 !important;
    text-align: left !important;
    position: relative;
    overflow: hidden !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.book-card::after {
    display: block !important;
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-md);
    padding: 1px;
    background: linear-gradient(135deg, transparent 70%, var(--primary) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.book-card:hover {
    transform: translateY(-5px) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3) !important;
}

.book-card:hover::after {
    opacity: 1 !important;
}

.book-cover-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #0b0f19;
    border-bottom: 1px solid var(--border-color);
}

.book-cover {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

/* Hide 3D book cover elements */
.book-spine,
.book-cover::after,
.book-cover::before,
.book-cover-overlay {
    display: none !important;
}

/* Ribbon Badge styling */
.book-card .tool-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
}

.book-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.book-info h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    transition: color 0.3s ease;
    line-height: 1.4;
}

.book-card:hover .book-info h3 {
    color: var(--primary);
}

.book-info p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

/* Header Navigation & Dropdowns */
.header-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 20px;
}

.header-nav-link {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.header-nav-link:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.02);
}

.header-dropdown-wrapper {
    position: relative;
    z-index: 1100;
}

.header-nav-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
}

.header-nav-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.header-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: min(650px, calc(100vw - 32px));
    max-height: min(70vh, 620px);
    overflow-y: auto;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    padding: 16px;
    z-index: 10050;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px 12px;
}

.header-dropdown-menu.show {
    display: grid;
    animation: headerFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes headerFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.header-dropdown-item:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.04);
}

.header-dropdown-item svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.header-dropdown-item:hover svg {
    color: var(--primary);
}

/* Mobile Search Icon Toggle trigger */
.search-toggle-btn {
    display: none;
    color: var(--text-secondary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s;
}

.search-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.search-toggle-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 1024px) {
    .header-nav {
        display: none !important; /* Hide header links completely on mobile/tablet */
    }
    
    .search-toggle-btn {
        display: flex !important;
    }
    
    .search-container {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-surface);
        padding: 0 16px;
        align-items: center;
        z-index: 1001;
        max-width: none !important;
    }
    
    .search-container.active {
        display: flex !important;
    }
    
    .search-close-mobile-btn {
        display: flex !important;
        align-items: center;
        background: none;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 0 8px;
        margin-right: 8px;
    }
    
    .app-header .header-left {
        width: 100%;
        justify-content: space-between;
    }
}

/* Rich Footer Styling */
.app-footer-rich {
    margin-top: 80px;
    padding: 60px 0 30px 0;
    border-top: 1px solid var(--border-color);
    width: 100%;
}

.footer-top {
    display: grid;
    grid-template-columns: 1.5fr repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 50px;
}

@media (max-width: 1024px) {
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 640px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-brand .logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-brand .logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    font-family: var(--font-heading);
}

.footer-brand .logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 22px;
    color: var(--text-primary);
}

.footer-brand .logo-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.footer-brand p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 320px;
}

.footer-socials {
    display: flex;
    gap: 12px;
}

.footer-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.footer-social-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.footer-app-badges {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.footer-app-badges span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.app-badge-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.app-badge-link:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.app-badge-link svg {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.app-badge-link:hover svg {
    color: var(--primary);
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-column h4 {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.footer-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link-item a {
    font-size: 13.5px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.footer-link-item a:hover {
    color: var(--primary);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-bottom p {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer-legal-links {
    display: flex;
    gap: 20px;
}

.footer-legal-links a {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal-links a:hover {
    color: var(--primary);
}

.footer-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    max-width: 800px;
    line-height: 1.6;
    margin-top: 8px;
}

/* Footer Barcode & QR Code Styles (Adani Electricity Layout) */
.footer-barcode-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    align-items: flex-start;
}

.barcode-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.barcode-row {
    display: flex;
    gap: 16px;
}

.barcode-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.barcode-item:hover {
    transform: translateY(-2px);
}

.barcode-svg {
    color: #121826; /* Dark background on the QR vector blocks */
    background: #ffffff;
    padding: 4px;
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.barcode-item:hover .barcode-svg {
    box-shadow: 0 0 12px var(--primary-glow);
}

.barcode-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Premium App Badges Hover styling */
.app-store-badge {
    transition: transform 0.2s ease;
}
.app-store-badge:hover {
    transform: translateY(-2px);
}
.app-store-badge svg {
    border-color: rgba(255,255,255,0.12);
    transition: border-color 0.2s ease;
}
.app-store-badge:hover svg {
    border-color: var(--primary);
}



