/* cover_letter.css */

:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --primary-light: #6366f1;
    --secondary: #7c3aed;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --bg-main: #0a0f1c;
    --bg-secondary: #111827;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(15, 23, 42, 0.95);
    --card-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 30px 60px rgba(79, 70, 229, 0.15);
}

/* Base Styles */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(79, 70, 229, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(124, 58, 237, 0.08) 0%, transparent 40%),
        linear-gradient(to bottom right, var(--bg-main) 0%, #111827 100%);
}

/* Light Mode */
body.light-mode {
    --bg-main: #f8fafc;
    --bg-secondary: #ffffff;
    --text-main: #0f172a;
    --text-muted: #475569;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(203, 213, 225, 0.8);
    --nav-bg: rgba(255, 255, 255, 0.95);
    
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

/* Text fixes for light mode */
body.light-mode .text-white:not(.btn-primary-glow *):not(.glass-panel.text-white) { 
    color: #0f172a !important; 
}
body.light-mode .text-gray-400 { 
    color: #64748b !important; 
}
body.light-mode .text-gray-300 { 
    color: #475569 !important; 
}
body.light-mode .text-gray-500 { 
    color: #6b7280 !important; 
}

/* A4 Paper Styling */
.a4-page {
    width: 210mm;
    min-height: 297mm;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    margin: 0 auto;
    padding: 25mm;
    position: relative;
    color: #333;
    font-family: 'Merriweather', 'Georgia', serif;
    line-height: 1.6;
}

/* Light mode adjustments for preview */
body.light-mode .a4-page {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Navbar */
.nav-glass {
    background: var(--nav-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-link {
    position: relative;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

.nav-link:hover::after {
    width: 100%;
}

/* Glass Panels */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-panel:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--card-shadow-hover);
}

/* Buttons */
.btn-primary-glow {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    color: white !important;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 30px rgba(79, 70, 229, 0.3);
    background-size: 200% 200%;
    border: none;
}

.btn-primary-glow:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 20px 40px rgba(79, 70, 229, 0.4);
    background-position: 100% 50%;
    animation: gradient-shift 1.5s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Form Elements */
.form-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-input {
    width: 100%;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: var(--text-main);
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: rgba(15, 23, 42, 0.7);
}

body.light-mode .form-input {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(203, 213, 225, 0.8);
    color: #0f172a;
}

body.light-mode .form-input:focus {
    background: rgba(255, 255, 255, 0.95);
    border-color: var(--primary);
}

.form-label {
    position: absolute;
    left: 1rem;
    top: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 0.875rem;
    background: transparent;
    padding: 0 0.25rem;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -0.5rem;
    left: 0.75rem;
    font-size: 0.75rem;
    background: var(--bg-main);
    padding: 0 0.5rem;
    color: var(--primary);
}

body.light-mode .form-input:focus + .form-label,
body.light-mode .form-input:not(:placeholder-shown) + .form-label {
    background: #f8fafc;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--primary-dark), var(--secondary));
}

/* Loader Animation */
.loader {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Preview Specific Styles */
#cover-letter-preview {
    font-family: 'Merriweather', 'Georgia', serif;
    line-height: 1.6;
    color: #333;
}

#cover-letter-preview h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#cover-letter-preview .font-serif {
    font-family: 'Merriweather', 'Georgia', serif;
}

/* Responsive */
@media (max-width: 768px) {
    .glass-panel {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-input {
        padding: 0.875rem;
    }
    
    .a4-page {
        padding: 20mm;
        transform: scale(0.9);
        transform-origin: top center;
    }
}

@media (max-width: 640px) {
    .a4-page {
        padding: 15mm;
        transform: scale(0.8);
    }
    
    #cover-letter-preview h1 {
        font-size: 2rem;
    }
}

/* Floating Animation */
.float-animation {
    animation: float 3s ease-in-out infinite;
}

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

/* Icon Colors */
.text-blue-400 {
    color: #60a5fa;
}

.text-green-400 {
    color: #34d399;
}

.text-purple-400 {
    color: #a78bfa;
}

.text-yellow-400 {
    color: #fbbf24;
}

.text-cyan-400 {
    color: #22d3ee;
}

/* ================= MOBILE LIVE PREVIEW FIX ================= */

/* Wrapper */
.a4-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 12px 0;
    overflow-x: hidden;
}

/* Default A4 */
.a4-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    transform-origin: top center;
}

/* Tablet */
@media (max-width: 1024px) {
    .a4-page {
        transform: scale(0.78);
    }
}

/* Mobile – FULL SCREEN FIT */
@media (max-width: 640px) {
    .a4-page {
        width: 100%;
        min-height: auto;
        transform: none;
        padding: 16px;
        box-shadow: none;
    }
}

/* ================= PDF CLONE FIX ================= */

#pdf-clone {
    position: fixed;
    left: -9999px;
    top: 0;
    background: white;
}

#pdf-clone.a4-page {
    width: 210mm !important;
    min-height: 297mm !important;
    padding: 25mm !important;
    transform: none !important;
    box-shadow: none !important;
}


/* ================= LIVE PREVIEW (BUILDER STYLE) ================= */

.resume-preview {
    background: linear-gradient(135deg, rgba(15,23,42,0.9), rgba(30,41,59,0.9));
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

body.light-mode .resume-preview {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* A4 Wrapper */
.a4-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 12px 0;
}

/* A4 Page */
.a4-page {
    width: 210mm;
    min-height: 297mm;
    background: white;
    margin: 0 auto;
    transform-origin: top center;
}

/* Tablet */
@media (max-width: 1024px) {
    .a4-page {
        transform: scale(0.78);
    }
}

/* Mobile – Builder style */
@media (max-width: 640px) {
    .a4-page {
        width: 100%;
        min-height: auto;
        transform: none;
        padding: 16px;
        box-shadow: none;
    }
}


/* ================= EXTRA WIDE + COMPACT COVER LETTER PDF ================= */

.a4-page.pdf-mode {
    width: 210mm !important;
    min-height: 297mm !important;

    /* 🔥 EXTRA WIDE CONTENT */
    padding-left: 12mm !important;
    padding-right: 12mm !important;
    padding-top: 16mm !important;
    padding-bottom: 16mm !important;

    transform: none !important;
    box-shadow: none !important;
}

/* 🔽 TEXT COMPACTNESS (PDF ONLY) */
.a4-page.pdf-mode p,
.a4-page.pdf-mode div,
.a4-page.pdf-mode span {
    font-size: 13px !important;     /* Pehle ~15–16px tha */
    line-height: 1.45 !important;   /* Tight but readable */
}

/* Headings thode balanced */
.a4-page.pdf-mode h1 {
    font-size: 22px !important;
}

.a4-page.pdf-mode h2 {
    font-size: 16px !important;
}

.a4-page.pdf-mode h3 {
    font-size: 14px !important;
}

/* ===== COVER LETTER PDF: LINE SPACING REDUCE ONLY ===== */

.a4-page.pdf-mode p,
.a4-page.pdf-mode li,
.a4-page.pdf-mode div {
    line-height: 1.3 !important;
}

/* ===== COVER LETTER PDF: BODY TEXT SIZE REDUCE ONLY ===== */

.a4-page.pdf-mode p {
    font-size: 9px !important;
}
/* =========================================
   USER DROPDOWN LIGHT MODE FIX
   ========================================= */

/* 1. Dropdown Container Background */
body.light-mode .group:hover .absolute {
    background-color: #ffffff !important;   /* Pure White Background */
    border-color: #e2e8f0 !important;       /* Light Grey Border */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important; /* Soft Shadow */
}

/* 2. Header Section (User Name & Email) */
body.light-mode .group .absolute .border-b {
    border-bottom-color: #f1f5f9 !important; /* Light separator line */
}

body.light-mode .group .absolute p.font-bold {
    color: #1e293b !important; /* Dark Text for Name */
}

body.light-mode .group .absolute p.text-gray-400 {
    color: #64748b !important; /* Medium Grey for Email */
}

/* 3. Dropdown Links (Dashboard, Logout) */
body.light-mode .group .absolute a {
    color: #334155 !important; /* Dark Grey Text */
}

/* 4. Hover State for Links */
body.light-mode .group .absolute a:hover {
    background-color: #f8fafc !important; /* Very Light Grey on Hover */
    color: #2563eb !important; /* Blue Text on Hover */
}

/* 5. Logout Link Specific */
body.light-mode .group .absolute a.text-red-400 {
    color: #ef4444 !important; /* Red Text */
}
body.light-mode .group .absolute a.text-red-400:hover {
    background-color: #fef2f2 !important; /* Light Red Background */
    color: #dc2626 !important; /* Darker Red on Hover */
}

/* 6. Main Button (User Icon + Name) in Navbar */
body.light-mode .group > button {
    background-color: rgba(0, 0, 0, 0.05) !important; /* Light transparent bg */
    border-color: rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .group > button .text-white {
    color: #1e293b !important; /* Dark Name Text */
}

body.light-mode .group > button .text-gray-400 {
    color: #64748b !important; /* Dark "Welcome" Text */
}

body.light-mode .group > button:hover {
    background-color: rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.5) !important; /* Blue border on hover */
}