/* Filename: global.css */

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --color-primary: #059669; 
    --color-primary-hover: #047857; 
    --color-secondary: #1e293b; 
    --color-accent: #f59e0b;
    --color-danger: #ef4444;
    --color-bg-body: #f8fafc; 
    --color-bg-white: #ffffff; 
    --color-text-main: #334155; 
    --color-text-muted: #64748b; 
    
    --color-border: #cbd5e1; 
    
    --container-width: 1280px;
    --header-height: 80px;
    --bottom-nav-height: 80px;
    --radius-md: 12px;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.12);
    
    --safe-area-bottom: env(safe-area-inset-bottom, 20px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: var(--color-bg-body);
    color: var(--color-text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
}

/* Mobile App Spacing */
@media (max-width: 992px) {
    body {
        padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    }
}

.container { width: 100%; max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 { color: var(--color-secondary); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
a { color: var(--color-primary); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--color-primary-hover); }

/* =========================================
   2. COMPONENTS: BUTTONS & INPUTS
   ========================================= */
.btn { 
    display: inline-flex; align-items: center; justify-content: center; 
    padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 600; 
    cursor: pointer; transition: all 0.2s; border: 1px solid transparent; 
    text-decoration: none; min-height: 44px; font-size: 1rem; line-height: 1;
}

.btn-primary { background: var(--color-primary); color: white; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); color: white; }

.btn-outline { background: white; color: var(--color-secondary); border-color: var(--color-border); }
.btn-outline:hover { background: #f8fafc; border-color: var(--color-primary); color: var(--color-primary); }

.btn-danger-outline { background: white; color: var(--color-danger); border-color: var(--color-border); }
.btn-danger-outline:hover { background: #fef2f2; border-color: var(--color-danger); }

.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; min-height: 36px; }
.w-100 { width: 100%; }

input, select, textarea { 
    width: 100%; padding: 0.75rem; border: 1px solid var(--color-border); 
    border-radius: 8px; background-color: var(--color-bg-white); 
    color: var(--color-text-main); font-size: 1rem; 
}
input:focus, select:focus, textarea:focus { 
    border-color: var(--color-primary); outline: none; 
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1); 
}

/* GLOBAL CARD STYLE */
.card { 
    background: var(--color-bg-white); 
    border-radius: var(--radius-md); 
    border: 1px solid var(--color-border); 
    overflow: hidden; 
    box-shadow: var(--shadow-sm); 
}
.card-body { padding: 1.5rem; }

/* =========================================
   3. HEADER & NAVIGATION (FIXED)
   ========================================= */
.site-header { 
    background: var(--color-bg-white); 
    position: sticky; top: 0; z-index: 1000; 
    border-bottom: 1px solid var(--color-border); 
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

.header-inner { 
    height: var(--header-height); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    gap: 20px; 
}

.site-branding { display: flex; align-items: center; gap: 15px; }
.site-title { font-size: 1.4rem; font-weight: 800; text-transform: uppercase; margin: 0; line-height: 1; }
.site-title a { color: var(--color-primary); text-decoration: none; }
.site-title-suffix { color: var(--color-secondary); }

.nav-menu { display: flex; gap: 25px; align-items: center; margin: 0; padding: 0; list-style: none; }
.nav-menu a { color: var(--color-text-main); font-weight: 600; text-decoration: none; }
.nav-menu a:hover { color: var(--color-primary); }

.header-actions { display: flex; align-items: center; gap: 15px; }
.search-trigger { font-size: 1.5rem; color: var(--color-text-main); padding: 5px; display: flex; align-items: center; }

/* Mobile Drawer Toggle */
#mobile-menu-toggle { 
    background: none; border: none; font-size: 1.8rem; 
    cursor: pointer; color: var(--color-secondary); padding: 0;
    display: flex; align-items: center;
}

@media (min-width: 993px) {
    #mobile-menu-drawer { display: none !important; }
    #mobile-menu-toggle { display: none !important; } 
    .main-navigation { display: block !important; }
    .desktop-only-text { display: inline; }
}

@media (max-width: 992px) { 
    .main-navigation { display: none; } 
    .btn-account span { display: none; }
    #mobile-menu-toggle { display: block; }
    .desktop-only-text { display: none; }
    .site-title { font-size: 1.1rem; }
    .header-actions { gap: 10px; }
    .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
}

#mobile-menu-drawer { 
    position: fixed; top: 0; left: -100%; width: 300px; height: 100%; 
    background: white; z-index: 2000; box-shadow: 2px 0 10px rgba(0,0,0,0.1); 
    transition: left 0.3s ease; display: flex; flex-direction: column; 
    border-right: 1px solid var(--color-border);
}
#mobile-menu-drawer.open { left: 0; }

body.admin-bar #mobile-menu-drawer { top: 32px; height: calc(100% - 32px); }
@media screen and (max-width: 782px) { body.admin-bar #mobile-menu-drawer { top: 46px; height: calc(100% - 46px); } }

.drawer-header { padding: 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #f1f5f9; background: #f8fafc; }
.drawer-title { font-weight: 800; font-size: 1.2rem; text-transform: uppercase; color: var(--color-secondary); }
#close-mobile-menu { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #64748b; }
.drawer-content { padding: 20px; overflow-y: auto; flex-grow: 1; }
.mobile-nav-list li { margin-bottom: 15px; }
.mobile-nav-list a { color: var(--color-text-main); font-weight: 600; font-size: 1.1rem; display: block; }
.drawer-actions { margin-top: auto; border-top: 1px solid #f1f5f9; padding-top: 20px; }

/* =========================================
   4. FOOTER & BOTTOM NAV
   ========================================= */
.site-footer { background-color: var(--color-secondary); color: #94a3b8; padding-top: 4rem; margin-top: 4rem; padding-bottom: 100px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3rem; margin-bottom: 4rem; }
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr; gap: 2rem; } }
.footer-heading { color: white; margin-bottom: 1rem; font-size: 1.2rem; font-weight: 700; }
.footer-title { color: white; font-size: 1.1rem; margin-bottom: 1.25rem; }
.footer-desc { font-size: 0.95rem; margin-bottom: 1.5rem; line-height: 1.6; }
.footer-menu li { margin-bottom: 0.75rem; }
.footer-menu a { color: #94a3b8; text-decoration: none; transition: color 0.2s; }
.footer-menu a:hover { color: white; text-decoration: underline; }
.site-info { background-color: rgba(0, 0, 0, 0.2); padding: 1.5rem 0; font-size: 0.875rem; }

.pmn-app-bottom-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: white; border-top: 1px solid var(--color-border); z-index: 9999; justify-content: space-around; padding-top: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -4px 10px rgba(0,0,0,0.05); }
.pmn-app-bottom-nav a { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: var(--color-text-muted); font-size: 0.7rem; gap: 4px; flex: 1; font-weight: 500; }
.pmn-app-bottom-nav a i { font-size: 1.4rem; margin-bottom: 2px; }
.pmn-app-bottom-nav a.active { color: var(--color-primary); font-weight: 700; }
@media (max-width: 992px) { .pmn-app-bottom-nav { display: flex; } }

/* =========================================
   5. MODALS & TOASTS
   ========================================= */
.pmn-toast { visibility: hidden; min-width: 250px; margin-left: -125px; background-color: #333; color: #fff; text-align: center; border-radius: 8px; padding: 16px; position: fixed; z-index: 10001; left: 50%; bottom: 30px; font-size: 1rem; box-shadow: var(--shadow-md); opacity: 0; transition: opacity 0.3s, bottom 0.3s; }
.pmn-toast.show { visibility: visible; opacity: 1; bottom: 100px; }

.pmn-modal { display: none; position: fixed; z-index: 10000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); backdrop-filter: blur(4px); align-items: center; justify-content: center; }
.pmn-modal.active { display: flex !important; animation: fadeIn 0.2s ease-out; }
.pmn-modal-content { background: white; padding: 2rem; border-radius: var(--radius-md); width: 90%; max-width: 500px; position: relative; box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1); max-height: 90vh; overflow-y: auto; border: 1px solid var(--color-border); }
.pmn-modal-close { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; cursor: pointer; color: var(--color-text-muted); width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: #f1f5f9; }
.pmn-modal-close:hover { background: #e2e8f0; color: var(--color-danger); }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* COOKIE BANNER STYLES (Fix) */
#pmn-cookie-banner {
    position: fixed; bottom: 20px; left: 20px; right: 20px; 
    background: #1e293b; color: white; padding: 15px; 
    border-radius: 12px; z-index: 10000; 
    display: flex; align-items: center; justify-content: space-between; 
    gap: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

/* =========================================
   6. PAGE & BLOG STYLES
   ========================================= */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 2rem; }
@media (max-width: 992px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

.narrow-container { max-width: 800px; margin: 0 auto; }
.bg-light { background-color: #f8fafc; padding: 3rem 0; border-bottom: 1px solid var(--color-border); }
.page-header { text-align: center; margin-bottom: 3rem; }
.entry-content { font-size: 1.1rem; line-height: 1.8; color: var(--color-text-main); }
.entry-content h2 { margin-top: 2rem; font-size: 1.75rem; }
.entry-content h3 { margin-top: 1.5rem; font-size: 1.4rem; }
.entry-content ul, .entry-content ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
.entry-content li { margin-bottom: 0.5rem; }

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }

/* =========================================
   7. AUTH FORMS & MODERN INPUTS
   ========================================= */
.pmn-modern-auth-wrapper { display: flex; justify-content: center; align-items: center; padding: 60px 20px; min-height: 70vh; background-color: var(--color-bg-body); }
.pmn-auth-card-simple { background: #ffffff; max-width: 480px; width: 100%; padding: 40px; border-radius: var(--radius-md); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05), 0 4px 6px -1px rgba(0,0,0,0.03); border: 1px solid var(--color-border); }
.pmn-status-icon { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 32px; }
.pmn-status-icon.success { background: #dcfce7; color: #166534; }
.pmn-status-icon.error { background: #fee2e2; color: #991b1b; }
.pmn-status-card { text-align: center; }
.pmn-status-note { background: #f8fafc; padding: 15px; border-radius: 8px; font-size: 0.95rem; margin: 20px 0; border: 1px solid #e2e8f0; color: var(--color-text-main); }
.pmn-status-note.error { background: #fff5f5; border-color: #fed7d7; color: #c53030; }
.pmn-auth-header-simple { text-align: center; margin-bottom: 30px; }
.pmn-auth-header-simple h2 { margin-bottom: 10px; color: var(--color-secondary); }
.pmn-auth-header-simple p { font-size: 0.95rem; color: var(--color-text-muted); }
.pmn-clean-form-simple { display: flex; flex-direction: column; gap: 20px; }
.pmn-field-simple { display: flex; flex-direction: column; gap: 8px; }
.pmn-field-simple label { font-weight: 600; font-size: 0.9rem; color: #475569; }
.pmn-field-simple input { padding: 12px 15px; border: 2px solid #e2e8f0; border-radius: 8px; font-size: 1rem; transition: border-color 0.2s; width: 100%; background: white; }
.pmn-field-simple input:focus { border-color: var(--color-primary); outline: none; }
.pmn-submit-btn-simple { background-color: var(--color-primary) !important; color: #ffffff !important; border: none !important; padding: 14px 24px !important; font-size: 1.1rem !important; font-weight: 700 !important; border-radius: 8px !important; cursor: pointer !important; width: 100% !important; text-align: center !important; text-decoration: none !important; transition: all 0.2s ease !important; margin-top: 10px !important; display: block !important; box-shadow: 0 4px 6px rgba(5, 150, 105, 0.2) !important; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: none !important; }
.pmn-submit-btn-simple:hover { background-color: var(--color-primary-hover) !important; transform: translateY(-2px); box-shadow: 0 10px 15px rgba(5, 150, 105, 0.3) !important; }
.pmn-msg-bar-simple { padding: 12px; border-radius: 8px; margin-bottom: 25px; text-align: center; font-size: 0.95rem; font-weight: 500; }
.pmn-msg-bar-simple.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.pmn-msg-bar-simple.success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* =========================================
   8. PWA INSTALL MODAL
   ========================================= */
.pmn-install-modal .pmn-modal-content {
    max-width: 420px;
    padding: 0;
    overflow: hidden;
}

.pmn-install-modal-body {
    padding: 2rem;
    text-align: center;
}

.pmn-install-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 10px 30px rgba(5, 150, 105, 0.3);
}

.pmn-install-icon i {
    font-size: 2.5rem;
    color: white;
}

.pmn-install-modal-body h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--color-secondary);
}

.pmn-install-modal-body > p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.pmn-install-benefits {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.pmn-install-benefits .benefit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-main);
    border: 1px solid var(--color-border);
}

.pmn-install-benefits .benefit i {
    font-size: 1.1rem;
    color: var(--color-primary);
}

.pmn-install-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pmn-install-actions .btn-primary {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    gap: 8px;
}

.pmn-install-actions .btn-secondary {
    background: transparent;
    color: var(--color-text-muted);
    border: none;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.pmn-install-actions .btn-secondary:hover {
    color: var(--color-text-main);
    background: transparent;
}

/* iOS Instructions */
.pmn-ios-instructions {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: #fffbeb;
    border-radius: 12px;
    border: 1px solid #fcd34d;
    text-align: left;
}

.pmn-ios-instructions p {
    color: #92400e;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.pmn-ios-instructions ol {
    padding-left: 1.25rem;
    margin: 0;
    color: #78350f;
    font-size: 0.9rem;
}

.pmn-ios-instructions li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.pmn-ios-instructions i {
    color: #059669;
}

/* Install Button Highlight Animation */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
}

.pmn-app-bottom-nav a.highlight-install {
    color: var(--color-primary);
    animation: pulseGlow 2s infinite;
}

/* Responsive */
@media (max-width: 480px) {
    .pmn-install-modal-body {
        padding: 1.5rem;
    }
    
    .pmn-install-benefits {
        gap: 0.5rem;
    }
    
    .pmn-install-benefits .benefit {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}