/* 
 * Trending Adda Scanner - Style Sheet
 * Premium SaaS Style Design (Blue, White, Black Theme)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-glow: rgba(37, 99, 235, 0.15);
    
    --bg-dark: #090d16;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-white: #ffffff;
    
    --text-white: #ffffff;
    --text-light: #f3f4f6;
    --text-dark: #111111;
    --text-muted: #9ca3af;
    --text-gray: #4b5563;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --border-dark: #1f2937;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 25px rgba(37, 99, 235, 0.25);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

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

/* Background Gradients */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    bottom: 20%;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    z-index: -2;
    pointer-events: none;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-white);
    font-weight: 700;
    line-height: 1.2;
}

p {
    font-size: 1rem;
    color: var(--text-muted);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

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

.text-center {
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-normal);
    outline: none;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--text-white);
    border: 1px solid transparent;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: var(--shadow-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-white);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.btn-white {
    background-color: var(--bg-white);
    color: var(--text-dark);
    border: 1px solid transparent;
}

.btn-white:hover {
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.btn-icon {
    padding: 8px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Header Styles */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition-normal);
}

.site-header.sticky {
    background-color: rgba(9, 13, 22, 0.85);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    transition: var(--transition-normal);
}

.site-header.sticky .header-container {
    height: 70px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 44px;
    width: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-white);
    background: linear-gradient(135deg, #fff 40%, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 8px;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px;
    right: 16px;
    height: 2px;
    background-color: var(--primary);
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform var(--transition-normal);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-white);
    background-color: rgba(255, 255, 255, 0.03);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-white);
    margin: 5px 0;
    transition: var(--transition-normal);
}

/* Glassmorphism Card Style */
.glass-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    padding: 30px;
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.glass-panel:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow-lg), var(--primary-glow);
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 48px;
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.hero-tag {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-glow);
    border: 1px solid rgba(37, 99, 235, 0.3);
    color: var(--primary-light);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-title {
    font-size: 3.5rem;
    line-height: 1.15;
    letter-spacing: -1.5px;
}

.hero-title span {
    background: linear-gradient(135deg, var(--primary-light) 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    font-size: 1.15rem;
    max-width: 540px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
}

/* 3D Transparent Cube Animation */
.hero-visual {
    position: relative;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.cube-container {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
}

.cube {
    width: 100%;
    height: 100%;
    position: absolute;
    transform-style: preserve-3d;
    animation: rotateCube 12s linear infinite;
}

.cube-face {
    position: absolute;
    width: 200px;
    height: 200px;
    border: 1px solid rgba(37, 99, 235, 0.45);
    background: rgba(17, 24, 39, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 25px rgba(37, 99, 235, 0.2), 0 0 20px rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    font-family: var(--font-heading);
    font-weight: 600;
    transition: background 0.3s ease;
}

.cube-face span {
    font-size: 0.8rem;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cube-face i {
    filter: drop-shadow(0 0 8px rgba(37, 99, 235, 0.5));
    color: var(--primary-light);
}

/* Face positions in 3D Space */
.face-front  { transform: rotateY(0deg) translateZ(100px); }
.face-back   { transform: rotateY(180deg) translateZ(100px); }
.face-left   { transform: rotateY(-90deg) translateZ(100px); }
.face-right  { transform: rotateY(90deg) translateZ(100px); }
.face-top    { transform: rotateX(90deg) translateZ(100px); }
.face-bottom { transform: rotateX(-90deg) translateZ(100px); }

.glow-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    filter: blur(25px);
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); }
}

/* Tool Interface General Container */
.tool-section {
    position: relative;
    padding-bottom: 100px;
}

.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 60px;
}

/* Scanner Interface */
.scanner-container {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 550px;
}

@media(min-width: 992px) {
    .scanner-container {
        grid-template-columns: 320px 1fr;
    }
}

.scanner-sidebar {
    background-color: rgba(9, 13, 22, 0.4);
    border-bottom: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media(min-width: 992px) {
    .scanner-sidebar {
        border-bottom: none;
        border-right: 1px solid var(--border-color);
    }
}

.scanner-sidebar-title {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.scanned-pages-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    flex-grow: 1;
}

@media(min-width: 992px) {
    .scanned-pages-list {
        flex-direction: column;
        overflow-x: visible;
        overflow-y: auto;
        max-height: 400px;
        padding-bottom: 0;
    }
}

.scanned-page-item {
    position: relative;
    flex-shrink: 0;
    width: 90px;
    height: 120px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: #000;
    transition: var(--transition-fast);
}

@media(min-width: 992px) {
    .scanned-page-item {
        width: 100%;
        height: 100px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px;
    }
}

.scanned-page-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.3);
}

.scanned-page-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media(min-width: 992px) {
    .scanned-page-thumb {
        width: 60px;
        height: 80px;
        border-radius: 4px;
    }
}

.scanned-page-num {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

@media(min-width: 992px) {
    .scanned-page-num {
        position: static;
        background: none;
        padding: 0;
        font-size: 0.9rem;
    }
}

.page-item-details {
    display: none;
}

@media(min-width: 992px) {
    .page-item-details {
        display: flex;
        flex-direction: column;
        flex-grow: 1;
    }
    .page-item-name {
        font-size: 0.85rem;
        font-weight: 500;
        color: var(--text-white);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 130px;
    }
}

.scanned-page-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 10;
}

.scanned-page-item:hover .scanned-page-delete {
    opacity: 1;
}

@media(min-width: 992px) {
    .scanned-page-delete {
        position: static;
        margin-left: auto;
        opacity: 0.7;
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    .scanned-page-delete:hover {
        opacity: 1;
        background: rgb(220, 38, 38);
    }
}

.scanner-workspace {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: relative;
    background-color: rgba(9, 13, 22, 0.2);
}

.upload-zone {
    width: 100%;
    max-width: 580px;
    min-height: 300px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-normal);
    background: rgba(255, 255, 255, 0.01);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.03);
    box-shadow: inset 0 0 20px rgba(37, 99, 235, 0.05);
}

.upload-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--primary-light);
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.upload-zone h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.upload-zone p {
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.upload-or {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.upload-or::before, .upload-or::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background-color: var(--border-color);
}

.upload-or span {
    padding: 0 15px;
}

/* Camera Stream Area */
.camera-view {
    display: none;
    width: 100%;
    max-width: 640px;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
}

.camera-stream {
    width: 100%;
    height: auto;
}

.camera-stream.mirrored {
    transform: scaleX(-1);
}

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 30px solid rgba(0,0,0,0.5);
    pointer-events: none;
}

.camera-guide-box {
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    border: 2px dashed rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.4);
}

.camera-controls {
    position: absolute;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.shutter-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    border: 5px solid rgba(37, 99, 235, 0.4);
    cursor: pointer;
    transition: var(--transition-fast);
}

.shutter-btn:hover {
    transform: scale(1.1);
}

/* Interactive Crop Area */
.crop-view {
    display: none;
    position: relative;
    max-width: 100%;
    max-height: 550px;
    margin: 0 auto;
}

.crop-canvas-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 480px;
    display: inline-block;
    overflow: hidden;
}

.crop-image-underlay {
    max-width: 100%;
    max-height: 480px;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.crop-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.crop-polygon {
    fill: rgba(37, 99, 235, 0.15);
    stroke: var(--primary-light);
    stroke-width: 2.5;
    stroke-dasharray: 4;
}

.crop-handle {
    fill: #ffffff;
    stroke: var(--primary);
    stroke-width: 4;
    r: 14;
    cursor: move;
    transition: r var(--transition-fast);
}

.crop-handle:hover {
    r: 18;
    fill: var(--primary-light);
}

/* Workspace Preview Area */
.preview-view {
    display: none;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.preview-canvas {
    max-width: 100%;
    max-height: 450px;
    border-radius: 4px;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-color);
    background: #fff;
}

/* Tool Workspace Controls bar */
.workspace-controls {
    width: 100%;
    padding: 20px 0 0 0;
    border-top: 1px solid var(--border-color);
    display: none;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.filter-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    width: 100%;
}

.filter-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.08);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--text-white);
    border-color: var(--primary);
}

/* OCR Interface specific */
.ocr-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media(min-width: 992px) {
    .ocr-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

.ocr-drop-area {
    min-height: 350px;
}

.ocr-result-area {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.ocr-output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.ocr-textarea {
    width: 100%;
    height: 260px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    padding: 16px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    outline: none;
    transition: var(--transition-fast);
}

.ocr-textarea:focus {
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.3);
}

.ocr-stats {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.ocr-actions-row {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}

.ocr-lang-select {
    padding: 8px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    outline: none;
    font-size: 0.9rem;
    cursor: pointer;
}

/* Progress Spinner Overlay */
.ocr-progress-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(9, 13, 22, 0.85);
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    backdrop-filter: blur(8px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-white);
}

.progress-bar-container {
    width: 240px;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--primary-light);
    transition: width 0.1s ease;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PDF Converters Interface (JPG/PNG) */
.converter-workspace {
    padding: 30px;
}

.converter-controls-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.converter-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.setting-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.setting-select {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    outline: none;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 120px;
}

.images-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    min-height: 200px;
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.images-preview-grid.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.image-preview-card {
    position: relative;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    cursor: grab;
    transition: var(--transition-fast), transform var(--transition-fast);
}

.image-preview-card:active {
    cursor: grabbing;
}

.image-preview-card.dragged {
    opacity: 0.5;
    transform: scale(0.95);
}

.image-card-img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    background: #000;
}

.image-card-name {
    padding: 6px 8px;
    font-size: 0.75rem;
    color: var(--text-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    background: rgba(0, 0, 0, 0.4);
}

.image-card-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 5;
}

.image-preview-card:hover .image-card-remove {
    opacity: 1;
}

.image-card-remove:hover {
    background: rgb(220, 38, 38);
}

/* Features Grid */
.features-section {
    background-color: rgba(9, 13, 22, 0.3);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-header {
    max-width: 680px;
    margin: 0 auto 60px auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

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

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.feature-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    background: var(--primary-glow);
    border: 1px solid rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
}

.feature-card h3 {
    font-size: 1.35rem;
}

/* Call To Action */
.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-box {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.cta-box h2 {
    font-size: 3rem;
    letter-spacing: -1.5px;
}

.cta-box p {
    font-size: 1.15rem;
    max-width: 600px;
}

/* Footer Styles */
.site-footer {
    background-color: #05080e;
    border-top: 1px solid var(--border-color);
    padding: 80px 0 30px 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

@media(min-width: 992px) {
    .footer-grid {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-desc {
    font-size: 0.95rem;
    line-height: 1.5;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.social-icon.facebook:hover {
    background-color: #1877f2;
    color: white;
    border-color: #1877f2;
    box-shadow: 0 0 15px rgba(24, 119, 242, 0.4);
}

.social-icon.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%,#285AEB 90%);
    color: white;
    border-color: transparent;
    box-shadow: 0 0 15px rgba(214, 36, 159, 0.4);
}

.social-icon.x:hover {
    background-color: #000000;
    color: white;
    border-color: #333;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.social-icon.youtube:hover {
    background-color: #ff0000;
    color: white;
    border-color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

.footer-col h4 {
    font-size: 1.1rem;
    color: var(--text-white);
    position: relative;
    padding-bottom: 8px;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    font-size: 0.95rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
}

.footer-link:hover {
    color: var(--text-white);
    transform: translateX(4px);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

@media(min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

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

.footer-bottom-links {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.footer-bottom-links a:hover {
    color: var(--text-white);
}

/* Content Page Layout Styles */
.content-hero {
    position: relative;
    padding: 140px 0 60px 0;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-color);
}

.content-hero-title {
    font-size: 3rem;
    margin-bottom: 12px;
    letter-spacing: -1.5px;
}

.breadcrumbs {
    display: flex;
    gap: 8px;
    list-style: none;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.breadcrumbs a:hover {
    color: var(--text-white);
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    margin-left: 8px;
}

.rich-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: var(--text-light);
}

.rich-content h2 {
    font-size: 1.85rem;
    margin: 40px 0 16px 0;
    color: var(--text-white);
}

.rich-content h3 {
    font-size: 1.35rem;
    margin: 30px 0 12px 0;
    color: var(--text-white);
}

.rich-content p {
    margin-bottom: 20px;
    line-height: 1.75;
}

.rich-content ul, .rich-content ol {
    margin-bottom: 24px;
    padding-left: 20px;
}

.rich-content li {
    margin-bottom: 8px;
}

/* Accordion FAQs */
.faq-list {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    color: var(--text-white);
    font-size: 1.15rem;
    font-weight: 600;
    cursor: pointer;
    padding: 12px 0;
}

.faq-question i {
    font-size: 1.1rem;
    color: var(--primary-light);
    transition: transform var(--transition-normal);
}

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

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
    color: var(--text-muted);
}

.faq-answer-content {
    padding: 8px 0 16px 0;
}

/* Contact Page Styles */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media(min-width: 992px) {
    .contact-grid {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.contact-form-card {
    padding: 40px;
}

.form-group-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 576px) {
    .form-group-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-white);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(0,0,0,0.3);
}

textarea.form-control {
    resize: vertical;
    min-height: 140px;
}

.contact-info-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-card {
    display: flex;
    gap: 16px;
}

.info-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-glow);
    border: 1px solid rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    flex-shrink: 0;
}

.info-card-content h4 {
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.info-card-content p {
    font-size: 0.95rem;
}

/* Toast Notification */
.toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid var(--border-color);
    color: var(--text-white);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-normal);
    backdrop-filter: blur(8px);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-info {
    border-left: 4px solid var(--primary-light);
}

/* 404 Page Specific */
.error-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.error-container {
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.error-code {
    font-size: 8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-light) 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.error-title {
    font-size: 2rem;
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: #090d16;
        flex-direction: column;
        align-items: center;
        padding-top: 40px;
        transition: var(--transition-normal);
        z-index: 999;
        border-top: 1px solid var(--border-color);
    }
    
    .nav-menu.open {
        left: 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 6px);
    }
    
    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -6px);
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-desc {
        margin: 0 auto;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .hero-visual {
        height: 380px;
        margin-top: 40px;
    }
    
    .cube-container {
        width: 160px;
        height: 160px;
    }
    
    .cube-face {
        width: 160px;
        height: 160px;
    }
    
    .face-front  { transform: rotateY(0deg) translateZ(80px); }
    .face-back   { transform: rotateY(180deg) translateZ(80px); }
    .face-left   { transform: rotateY(-90deg) translateZ(80px); }
    .face-right  { transform: rotateY(90deg) translateZ(80px); }
    .face-top    { transform: rotateX(90deg) translateZ(80px); }
    .face-bottom { transform: rotateX(-90deg) translateZ(80px); }
}

@media(max-width: 575px) {
    .hero-title {
        font-size: 2.25rem;
    }
    .hero-actions .btn {
        width: 100%;
    }
    .section-title {
        font-size: 2rem;
    }
    .cta-box h2 {
        font-size: 2.25rem;
    }
    .content-hero-title {
        font-size: 2.25rem;
    }
}

/* Crop Magnifier Glass UI */
.crop-magnifier {
    position: absolute;
    width: 130px;
    height: 130px;
    border: 3px solid var(--primary-light);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    display: none;
    z-index: 1000;
    overflow: hidden;
    background-color: #000;
}

.crop-magnifier-canvas {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Crosshair in the middle of the magnifier */
.crop-magnifier::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 1.5px solid var(--primary-light);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
    z-index: 1001;
}

/* Print Styling Utility */
@media print {
    body * {
        visibility: hidden;
    }
    .print-area, .print-area * {
        visibility: visible;
    }
    .print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .print-page-break {
        page-break-after: always;
        text-align: center;
    }
    .print-page-break img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }
}




/* --- Refined Document Scanner Workspace Toolbar and Annotations --- */

.scanner-workspace-toolbar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(17, 24, 39, 0.4);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    justify-content: space-between;
}

.toolbar-left, .toolbar-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background-color: var(--border-color);
    margin: 0 4px;
}

.btn-toolbar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-toolbar:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.btn-toolbar.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-white);
}

.btn-toolbar:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Drawing overlay wrapper */
.preview-canvas-container {
    position: relative;
    max-width: 100%;
    max-height: 450px;
    display: inline-block;
    border-radius: 4px;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-color);
    background: #fff;
    overflow: hidden;
}

.drawing-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.drawing-canvas.active {
    pointer-events: auto;
    cursor: crosshair;
}

/* Popup / Popover configurations */
.popover-menu {
    position: absolute;
    background: rgba(17, 24, 39, 0.98);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    display: none;
    flex-direction: column;
    gap: 12px;
    backdrop-filter: blur(12px);
    width: 250px;
}

.popover-menu.active {
    display: flex;
}

.popover-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-white);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
    margin-bottom: 4px;
}

.color-option-grid {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.color-dot {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-fast);
}

.color-dot.active {
    border-color: #fff;
    transform: scale(1.15);
}

.brush-size-slider {
    width: 100%;
    margin-top: 4px;
}

/* Setup Config Popover styling */
.setup-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setup-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.setup-group select {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-white);
    outline: none;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Page Thumbnail reordering & sorting improvements */
.scanned-page-item {
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.scanned-page-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-light);
}

.scanned-page-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.mobile-sort-controls {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding: 4px;
    background: rgba(0,0,0,0.6);
}

/* Extra utility classes */
.btn-danger-toolbar {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.btn-danger-toolbar:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.25) !important;
    color: #fca5a5 !important;
}

@media(max-width: 991px) {
    .scanner-workspace-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .toolbar-left, .toolbar-right {
        justify-content: center;
    }
}

/* Multi-Select, Collage, Signature and Share Overlay styling */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.scanned-page-item.selected {
    border-color: var(--primary) !important;
    box-shadow: 0 0 12px rgba(37, 99, 235, 0.5);
    transform: scale(0.96);
}

.scanned-page-item.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 99, 235, 0.1);
    pointer-events: none;
    z-index: 5;
}

.collage-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .collage-grid-layout {
        grid-template-columns: 1.2fr 0.8fr;
    }
}

.bulk-actions-panel {
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Draggable Signature Overlay Styling */
#signature-overlay {
    transition: box-shadow 0.2s ease;
}

#signature-overlay:hover {
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.6) !important;
}

.sig-resize-handle:hover {
    transform: scale(1.2);
    background: var(--primary-light) !important;
}

.btn-select-toggle.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Disable pointer events on children inside page items during multi-select mode to prevent click interception */
.scanned-pages-list.multi-select .scanned-page-item * {
    pointer-events: none;
}

/* Mobile responsiveness and layout optimization (Prevent clipping, remove card borders, and scale canvas) */
@media (max-width: 768px) {
    /* Remove card borders, backgrounds, and shadows to prevent clipping on mobile screens */
    .tool-card {
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        overflow: visible !important;
        margin-bottom: 20px;
    }
    
    .scanner-container {
        min-height: auto !important;
    }
    
    .scanner-workspace {
        padding: 12px !important;
        background-color: transparent !important;
    }
    
    .scanner-sidebar {
        padding: 12px 16px !important;
        gap: 12px !important;
        background-color: rgba(9, 13, 22, 0.2) !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    
    /* Optimize Crop View for Mobile screens & Center elements correctly */
    .crop-view {
        max-height: none !important;
        width: 100% !important;
        text-align: center !important; /* Centers inline-block children */
    }
    
    .crop-canvas-wrapper {
        max-height: 320px !important;
        display: inline-block !important;
    }
    
    .crop-image-underlay {
        max-height: 320px !important;
        max-width: 100% !important;
        display: block !important;
    }
    
    /* Make crop buttons stack/wrap beautifully on mobile */
    .crop-view > div:last-child {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        margin-top: 12px !important;
        justify-content: center !important;
        width: 100% !important;
    }
    
    .crop-view .btn {
        padding: 10px 14px !important;
        font-size: 0.85rem !important;
        flex: 1 1 calc(50% - 8px) !important; /* 2 buttons per row */
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Optimize preview workspace for mobile viewports */
    .preview-canvas-container {
        max-height: 340px !important;
    }

    /* Make camera viewfinder full bleed on mobile devices */
    .camera-view {
        max-width: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        background: #000 !important;
    }

    .camera-overlay {
        border: none !important; /* Remove the thick solid boundary overlay border */
    }

    .camera-stream {
        width: 100% !important;
        height: auto !important;
    }
}
