/* assets/css/custom.css */
@import url('fonts.css');

:root {
    --font-fira: 'Fira Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-serif: 'Playfair Display', Georgia, Cambria, 'Times New Roman', Times, serif;
}

body {
    font-family: var(--font-fira);
    background-color: #f6faf8;
    color: #1e293b;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.font-fira {
    font-family: var(--font-fira);
}

.font-serif-cert {
    font-family: var(--font-serif);
}

/* Bright & Clean Glassmorphism Styles */
.glass-card {
    background: #ffffff;
    border: 1px solid #e2ece7;
    box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
}

.glass-card-hover {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -6px rgba(16, 185, 129, 0.15), 0 4px 10px -2px rgba(0, 0, 0, 0.05);
    border-color: #86efac;
}

.glass-nav {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #e6f4ee;
    box-shadow: 0 2px 12px -2px rgba(16, 185, 129, 0.05);
}

/* Dark Mode Overrides */
html.dark body {
    background-color: #090f11 !important;
    color: #e2e8f0 !important;
}

html.dark .glass-card,
html.dark .bg-white {
    background-color: #101a1c !important;
    border-color: #1b2d30 !important;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
}

html.dark .glass-nav,
html.dark header {
    background-color: rgba(13, 22, 24, 0.95) !important;
    border-color: #1b2d30 !important;
}

html.dark footer {
    background-color: #080d0f !important;
    border-color: #1b2d30 !important;
}

html.dark .text-slate-900,
html.dark .text-slate-800 {
    color: #f8fafc !important;
}

html.dark .text-slate-700,
html.dark .text-slate-600 {
    color: #cbd5e1 !important;
}

html.dark .text-slate-500,
html.dark .text-slate-400 {
    color: #94a3b8 !important;
}

html.dark .bg-slate-50,
html.dark .bg-slate-100,
html.dark .bg-\[\#f8fbf9\],
html.dark .bg-\[\#f6faf8\] {
    background-color: #0d1719 !important;
    border-color: #1b2d30 !important;
}

html.dark .border-slate-200,
html.dark .border-slate-100,
html.dark .border-emerald-100,
html.dark .border-slate-200\/80,
html.dark .border-slate-200\/90 {
    border-color: #1b2d30 !important;
}

html.dark nav.bg-slate-100\/90,
html.dark nav.bg-slate-50\/80 {
    background-color: #0c1815 !important;
    border-color: rgba(6, 78, 59, 0.4) !important;
}

html.dark nav a:not(.bg-emerald-600) {
    color: #cbd5e1 !important;
}

html.dark nav a:not(.bg-emerald-600):hover {
    color: #6ee7b7 !important;
    background-color: rgba(6, 78, 59, 0.5) !important;
}

html.dark .bg-emerald-50,
html.dark .bg-emerald-50\/60,
html.dark .bg-emerald-50\/70 {
    background-color: rgba(6, 78, 59, 0.3) !important;
    color: #6ee7b7 !important;
    border-color: rgba(52, 211, 153, 0.3) !important;
}

html.dark .bg-teal-50 {
    background-color: rgba(19, 78, 74, 0.3) !important;
    color: #5eead4 !important;
    border-color: rgba(45, 212, 191, 0.3) !important;
}

html.dark .bg-amber-50 {
    background-color: rgba(120, 53, 15, 0.3) !important;
    color: #fde047 !important;
    border-color: rgba(251, 191, 36, 0.3) !important;
}

html.dark .bg-rose-50 {
    background-color: rgba(136, 19, 55, 0.3) !important;
    color: #fda4af !important;
    border-color: rgba(251, 113, 133, 0.3) !important;
}

html.dark .bg-cyan-50 {
    background-color: rgba(22, 78, 99, 0.3) !important;
    color: #67e8f9 !important;
    border-color: rgba(34, 211, 238, 0.3) !important;
}

html.dark .text-emerald-800,
html.dark .text-emerald-700 {
    color: #34d399 !important;
}

html.dark .text-teal-800,
html.dark .text-teal-700 {
    color: #2dd4bf !important;
}

html.dark .text-amber-800,
html.dark .text-amber-700 {
    color: #fbbf24 !important;
}

html.dark .text-rose-800,
html.dark .text-rose-700 {
    color: #fb7185 !important;
}

html.dark input,
html.dark select,
html.dark textarea {
    background-color: #0b1315 !important;
    color: #f8fafc !important;
    border-color: #1b2d30 !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: #64748b !important;
}

html.dark .modal-container .bg-white {
    background-color: #0f1b1e !important;
    border-color: #1b2d30 !important;
}

/* Gradients */
.gradient-eco {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #047857 100%);
}

.gradient-text-eco {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #047857 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gradient-gold {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f3;
}
html.dark ::-webkit-scrollbar-track {
    background: #090f11;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
html.dark ::-webkit-scrollbar-thumb {
    background: #1e3538;
}
::-webkit-scrollbar-thumb:hover {
    background: #10b981;
}

/* ==========================================================================
   Certificate Styles & Bulletproof A4 Landscape Print Rules
   ========================================================================== */
@page {
    size: A4 landscape;
    margin: 0mm;
}

.certificate-frame {
    background-color: #fdfbf7 !important;
    color: #1e293b;
    position: relative;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.12);
}

.certificate-border-outer {
    border: 6px double #065f46;
    outline: 2px solid #d97706;
}

/* Ensure certificate remains parchment paper color even in dark mode */
html.dark .certificate-frame {
    background-color: #fdfbf7 !important;
    color: #1e293b !important;
}
html.dark .certificate-frame * {
    color-scheme: light;
}

@media print {
    *, *::before, *::after {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
        box-sizing: border-box !important;
    }

    html, body {
        width: 297mm !important;
        height: 210mm !important;
        max-width: 297mm !important;
        max-height: 210mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #ffffff !important;
        overflow: hidden !important;
    }

    header, footer, nav, .no-print, #flash-toast, .modal-container, .dark-mode-toggle {
        display: none !important;
        height: 0 !important;
        width: 0 !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    main {
        margin: 0 !important;
        padding: 0 !important;
        max-width: 297mm !important;
        width: 297mm !important;
        height: 210mm !important;
        max-height: 210mm !important;
        overflow: hidden !important;
    }

    .certificate-container {
        margin: 0 !important;
        padding: 0 !important;
        width: 297mm !important;
        height: 210mm !important;
    }

    #certificate-printable {
        width: 297mm !important;
        height: 210mm !important;
        max-width: 297mm !important;
        max-height: 210mm !important;
        min-height: 210mm !important;
        position: fixed !important;
        left: 0 !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        margin: 0 !important;
        padding: 7mm !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid !important;
        page-break-after: avoid !important;
        page-break-before: avoid !important;
        break-inside: avoid !important;
        break-after: avoid !important;
        break-before: avoid !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        overflow: hidden !important;
        background-color: #fdfbf7 !important;
    }

    .certificate-inner {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        padding: 5mm !important;
    }
}
