/* =========================================
   MAHATOOLS PREMIUM THEME (FINAL CORRECTED)
   ========================================= */

:root {
    --primary: #6366f1;       /* Indigo */
    --primary-hover: #4f46e5;
    --secondary: #ec4899;     /* Pink */
    --bg-color: #f0f4f8;      /* Soft Grey */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 15px 40px rgba(148, 163, 184, 0.15);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    /* Animated Mesh Gradient */
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,0.05) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,0.05) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,0.05) 0, transparent 50%);
}

/* --- Animated Background Shapes --- */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: pulse 8s infinite alternate;
}
.shape-1 {
    top: -50px; left: -50px; width: 400px; height: 400px;
    background: rgba(99, 102, 241, 0.15);
}
.shape-2 {
    bottom: -50px; right: -50px; width: 300px; height: 300px;
    background: rgba(236, 72, 153, 0.15);
}

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

/* --- 1. Navbar (Glassmorphism) --- */
.top-navbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 40px;
    position: fixed; top: 0; width: 100%; z-index: 1000;
    
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: var(--glass-border);
}

.brand-link { text-decoration: none; display: flex; align-items: center; gap: 12px; }
.logo-icon {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem;
}
.brand-name { font-weight: 700; color: var(--text-main); font-size: 1.1rem; }
.brand-tag { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.nav-links { display: flex; gap: 30px; }
.nav-links a {
    text-decoration: none; color: var(--text-muted); font-weight: 500; font-size: 0.9rem;
    padding: 8px 12px; transition: 0.3s;
}
.nav-links a:hover, .nav-links a.active-link { color: var(--primary); }


/* --- 2. Layout & Home Page --- */
.app-container { padding-top: 90px; min-height: 100vh; padding-bottom: 40px; }
.full-width-layout .content { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

.hero-wrapper {
    padding: 20px 0; /* Add padding if needed */
}

.dashboard-hero {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
    border-radius: 25px; padding: 60px;
    display: flex; justify-content: space-between; align-items: center;
    color: white; position: relative; overflow: hidden;
    box-shadow: 0 20px 50px rgba(30, 27, 75, 0.3);
    margin-bottom: 40px;
}

.hero-content { max-width: 600px; z-index: 2; }
.badge-pill {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 5px 15px; border-radius: 20px;
    font-size: 0.85rem; color: #a5b4fc;
    display: inline-block; margin-bottom: 20px;
}

.hero-content h1 { 
    font-size: 3rem; margin-bottom: 20px; line-height: 1.2; 
}
.text-gradient {
    background: linear-gradient(to right, #818cf8, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-content p { color: #cbd5e1; font-size: 1.1rem; margin-bottom: 30px; }

.hero-actions { display: flex; gap: 15px; }

/* Hero Visuals (Floating Cards) */
.hero-visual { position: relative; width: 300px; height: 300px; display: none; }
@media(min-width: 992px) { .hero-visual { display: block; } }

.floating-card {
    position: absolute;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 15px;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: float 6s ease-in-out infinite;
    color: white; /* Ensure text is visible */
}
.card-1 { top: 20%; right: 0; animation-delay: 0s; }
.card-2 { top: 50%; right: 40px; animation-delay: 2s; }
.card-3 { top: 30%; right: 120px; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.tools-container { margin-bottom: 50px; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-title { font-size: 2rem; margin-bottom: 10px; color: var(--text-main); }
.section-subtitle { color: var(--text-muted); }

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

.tool-card {
    background: var(--card-bg); border-radius: 20px; padding: 30px;
    text-decoration: none; color: inherit; border: 1px solid #e2e8f0;
    transition: 0.4s; display: flex; flex-direction: column; gap: 15px;
}
.tool-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--primary); }

.card-icon-wrapper {
    width: 60px; height: 60px; border-radius: 15px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: white;
}
/* Icons Colors */
.icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3); }
.icon-green { background: linear-gradient(135deg, #10b981, #059669); box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3); }
.icon-orange { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 8px 20px rgba(217, 119, 6, 0.3); }
.icon-purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3); }

.card-content h3 { font-size: 1.25rem; margin-bottom: 8px; font-weight: 700; }
.card-content p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

.card-action {
    margin-top: auto;
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.9rem; font-weight: 600; color: var(--primary);
}
.card-action i { transition: 0.3s; }
.tool-card:hover .card-action i { transform: translateX(5px); }

/* --- 3. Tool Workspace (Passport, etc.) --- */
.tool-page-header {
    display: flex; align-items: center; gap: 20px;
    margin-bottom: 30px;
}
.header-icon-large {
    width: 64px; height: 64px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: white;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}
.tool-page-header h1 { font-size: 1.8rem; font-weight: 700; color: var(--text-main); margin-bottom: 5px; }
.tool-page-header p { color: var(--text-muted); }

/* Grid Layout */
.workspace-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 30px;
    align-items: start;
}

/* Glass Card */
.card-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    border: var(--glass-border);
    box-shadow: var(--shadow-md);
}

/* Sidebar Controls */
.panel-title { 
    font-size: 1rem; font-weight: 700; color: var(--text-main); 
    margin-bottom: 20px; text-transform: uppercase; letter-spacing: 0.5px;
}

.modern-upload-box {
    border: 2px dashed #cbd5e1;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center; cursor: pointer; transition: 0.3s;
    display: flex; flex-direction: column; align-items: center;
}
.modern-upload-box:hover { border-color: var(--primary); background: rgba(99, 102, 241, 0.05); }
.upload-icon { font-size: 1.4rem; color: var(--primary); margin-bottom: 10px; }
.modern-upload-box span { font-weight: 600; color: var(--text-main); }
.modern-upload-box small { color: var(--text-muted); font-size: 0.8rem; }

.hidden-input { display: none; }

.input-wrapper { margin-bottom: 15px; }
.input-wrapper label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; }

.modern-input {
    width: 100%; padding: 12px 16px;
    border: 1px solid transparent; 
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 0.95rem; color: var(--text-main);
    transition: 0.3s;
}
.modern-input:focus {
    background: #fff; border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); outline: none;
}
.dual-input { display: flex; align-items: center; gap: 10px; }

/* Buttons */
.cta-button {
    border: none; padding: 14px; border-radius: 12px;
    font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: 0.3s; text-decoration: none; font-size: 0.95rem;
}
.primary-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.primary-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4); }
.secondary-btn { background: #fff; color: var(--text-main); border: 1px solid #e2e8f0; }
.secondary-btn:hover { background: #f8fafc; }

.action-buttons { margin-top: 25px; display: flex; flex-direction: column; gap: 12px; }
.full-width { width: 100%; }

/* Glass Divider */
.glass-divider { margin: 20px 0; border: 0; border-top: 1px solid #e2e8f0; }

/* --- Preview Area --- */
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
/* badge-pill style reused from hero section */

.paper-stage-wrapper {
    background: #cbd5e1; /* Contrast Background */
    border-radius: 20px;
    padding: 40px;
    overflow: auto;
    display: flex; justify-content: center;
    min-height: 500px;
}

.a4-page {
    width: 210mm; min-height: 297mm;
    background: white;
    /* 3D Paper Shadow */
    box-shadow: 
        0 1px 1px rgba(0,0,0,0.15), 
        0 10px 0 -5px #eee, 
        0 10px 1px -4px rgba(0,0,0,0.15), 
        0 20px 0 -10px #eee, 
        0 20px 1px -9px rgba(0,0,0,0.15);
    margin: 0 auto;
    transform-origin: top center;
    padding: 10mm; /* Printer Margin */
    display: flex; flex-wrap: wrap; align-content: flex-start;
}

.empty-state-modern {
    height: 100%; width: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #94a3b8; border: 2px dashed #e2e8f0; border-radius: 10px; margin: 0;
}
.empty-state-modern i { font-size: 3rem; margin-bottom: 10px; }

/* Photo in Grid */
.photo-wrapper {
    display: inline-block;
    box-sizing: border-box;
    
    /* फोटोभोवती थोडा white margin (cutting area) */
    padding: 1mm;
    background: #ffffff;

    /* ✂️ cutting guide line */
    border: 1px dashed #ff0000;   /* हवी तर dotted पण करू शकतो */
}

/* फोटोवर border नको – full area fill करेल */
.photo-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}



/* =========================================
   ✅ FIX: MODAL OVERLAY (POPUP)
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Dark Dim */
    backdrop-filter: blur(8px);
    z-index: 10000; /* Highest Z-Index */
    display: none; /* JS toggles to flex */
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    width: 95%; max-width: 500px;
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    animation: zoomIn 0.3s ease;
}

.modal-header { padding: 20px 25px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.modal-header h4 { font-weight: 700; margin: 0; }
.close-modal { font-size: 1.5rem; cursor: pointer; color: #94a3b8; }

.crop-body { background: #0f172a; padding: 20px; height: 400px; display: flex; align-items: center; justify-content: center; }
.img-container { width: 100%; height: 100%; }
.img-container img { max-width: 100%; max-height: 100%; display: block; }

.edit-controls-wrapper { padding: 20px; background: white; }
.slider-group { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.slider-group label { width: 30px; color: var(--text-muted); }
.modern-range { width: 100%; accent-color: var(--primary); }

.rotate-actions { display: flex; justify-content: center; gap: 15px; margin-top: 10px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 50%; border: 1px solid #e2e8f0; background: white;
    cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }

.modal-footer { padding: 20px; display: flex; justify-content: flex-end; gap: 10px; background: #f8fafc; border-top: 1px solid #e2e8f0; }

@keyframes zoomIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* --- 4. Footer --- */
.about-footer { padding: 0 5% 40px; text-align: center; }
.footer-glass {
    background: white;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
}
.footer-logo { height: 40px; margin-bottom: 15px; }
.social-links { margin: 20px 0; display: flex; justify-content: center; gap: 20px; }
.social-links a {
    width: 40px; height: 40px;
    background: #f1f5f9; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-main); text-decoration: none; transition: 0.3s;
}
.social-links a:hover { background: var(--primary); color: white; transform: scale(1.1); }
.copyright { color: #94a3b8; font-size: 0.85rem; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .workspace-grid { grid-template-columns: 1fr; }
    .a4-page { transform: scale(0.6); transform-origin: top center; margin-bottom: -100mm; }
    .top-navbar { padding: 10px 20px; }
    
    /* Hide nav links on mobile for simplicity, or implement mobile menu */
    .nav-links { display: none; }
    
    .dashboard-hero { padding: 40px 20px; text-align: center; flex-direction: column; }
    .hero-content h1 { font-size: 2rem; }
    .hero-actions { justify-content: center; }
}