/* =========================================================================
   COMPLETE SITE CSS — Frontend + Admin Portal + Modal + Trail
   Overwrites anything previous. Paste as assets/css/style.css
   ========================================================================= */

/* -----------------------------------
   ROOT / GLOBAL
----------------------------------- */
:root {
    --primary: #0071e3;
    --primary-dark: #005bb8;
    --danger: #d7263d;
    --glass: rgba(255,255,255,0.45);
    --bg: #f5f7fa;
    --text: #222;
    --muted: rgba(0,0,0,0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html,body { height: 100%; }
body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
    overflow-x: hidden;
}

/* Helper container */
.container {
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 48px 0;
}

/* -----------------------------------
   LIQUID GLASS CARD
----------------------------------- */
.liquid-glass {
    background: var(--glass);
    backdrop-filter: blur(14px) saturate(140%);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

/* -----------------------------------
   NAV / TOP BAR
----------------------------------- */
nav {
    width: 100%;
    padding: 14px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 2000;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

nav .brand { font-weight: 700; font-size: 1.1rem; }
nav a {
    margin-left: 20px;
    text-decoration: none;
    font-weight: 600;
    color: var(--text);
    transition: color .18s;
}
nav a:hover { color: var(--primary); }

/* -----------------------------------
   HERO (FRONT PAGE)
----------------------------------- */
.hero {
    padding-top: 36px;
    padding-bottom: 36px;
}

.hero-box {
    padding: 48px;
    display: block;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.08;
    margin-bottom: 16px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.highlight-blue { color: var(--primary); }

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(0,0,0,0.62);
    margin-bottom: 22px;
}

/* Button base */
.btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    text-decoration: none;
    text-align: center;
    transition: transform .12s ease, background .12s ease, box-shadow .12s;
}

.btn:active { transform: translateY(1px); }

/* Primary button */
.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 18px rgba(0,113,227,0.14);
}
.btn-primary:hover { background: var(--primary-dark); }

/* -----------------------------------
   GRID & STATS
----------------------------------- */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    align-items: stretch;
}

.stat-card {
    padding: 28px 20px;
    text-align: center;
}
.stat-num { font-size: 2.2rem; font-weight: 800; display:block; }
.stat-label { opacity: 0.75; margin-top:6px; }

/* -----------------------------------
   PRINCIPAL BOX
----------------------------------- */
.principal-box {
    display: flex;
    gap: 22px;
    align-items: center;
    padding: 22px;
}

.principal-text {
    font-size: 1rem;
    color: rgba(0,0,0,0.7);
    line-height: 1.6;
}

.circle-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: linear-gradient(180deg,#e6e6e6,#d0d0d0);
    flex-shrink: 0;
}

/* -----------------------------------
   POSTS / CARD PREVIEWS
----------------------------------- */
.post-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-date { font-size: 0.82rem; text-transform: uppercase; opacity: .65; margin-bottom: 8px; }
.post-title { font-size: 1.15rem; margin-bottom: 8px; }
.post-preview { color: rgba(0,0,0,0.72); flex-grow:1; margin-bottom:12px; }
.post-link { color: var(--primary); font-weight:700; text-decoration:none; }

/* -----------------------------------
   FOOTER
----------------------------------- */
footer {
    text-align: center;
    padding: 32px 0;
    color: rgba(0,0,0,0.55);
}

/* -----------------------------------
   ADMIN PORTAL LAYOUT
----------------------------------- */
.portal-container {
    width: 92%;
    max-width: 1400px;
    margin: 28px auto;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

/* Sidebar */
.portal-sidebar {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 14px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.35);
}

.portal-sidebar a {
    display: block;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none !important;
    font-weight: 700;
    color: var(--text) !important;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.06);
    transition: transform .12s ease, background .12s;
}
.portal-sidebar a:hover { background: rgba(0,113,227,0.12); color: var(--primary) !important; }
.portal-sidebar a.active { background: var(--primary) !important; color: #fff !important; box-shadow: 0 8px 28px rgba(0,113,227,0.12); }

/* Main panel */
.portal-content {
    padding: 22px;
    border-radius: 14px;
    background: rgba(255,255,255,0.6);
}

/* -----------------------------------
   TABLES
----------------------------------- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid rgba(0,0,0,0.06); }
.data-table th { background: rgba(0,0,0,0.03); font-weight:700; text-transform: uppercase; font-size:0.82rem; }

/* -----------------------------------
   FORMS (shared)
----------------------------------- */
.form-group { margin-bottom: 16px; }
.form-label { display:block; font-weight:700; margin-bottom:8px; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.85);
    transition: box-shadow .12s, border-color .12s;
}
.form-control:focus { outline:none; border-color: var(--primary); box-shadow: 0 6px 18px rgba(0,113,227,0.08); }

/* larger textarea */
.form-control[type="textarea"], textarea.form-control { min-height: 120px; resize: vertical; }

/* -----------------------------------
   CUSTOM FILE INPUT
----------------------------------- */
.file-input-wrapper {
    display:flex; align-items:center; gap:10px;
    padding:10px; border-radius:10px;
    background: rgba(255,255,255,0.9);
    border:1px solid rgba(0,0,0,0.06);
}
.file-input-wrapper input[type="file"]{ display:none; }
.file-browse-btn { padding:8px 14px; background:var(--primary); color:#fff; border-radius:8px; cursor:pointer; font-weight:700; }
.file-browse-btn:hover { background:var(--primary-dark); }
#selected-file-name { font-size:0.95rem; opacity:.75; }

/* upload progress */
.upload-progress { width:100%; height:12px; background: rgba(0,0,0,0.05); border-radius:8px; overflow:hidden; margin-top:10px; display:none; }
.upload-progress-bar { height:100%; width:0; background:var(--primary); transition: width .16s linear; }


/* ================================
   FIX CALENDAR STRETCH / LAYOUT
================================ */

.calendar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    padding: 10px;
}

.calendar .day {
    background: rgba(255,255,255,0.7);
    border-radius: 8px;
    padding: 6px;
    text-align: center;
    font-size: 0.9rem;
    aspect-ratio: 1 / 1; /* <-- makes perfect squares */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.calendar .day:hover {
    background: rgba(0,113,227,0.15);
}

/* Label row fix */
.calendar .day-label {
    aspect-ratio: unset;
    font-weight: 700;
    background: transparent !important;
    cursor: default;
}

/* -----------------------------------
   MODAL (Apply Now)
----------------------------------- */
.modal-overlay {
    position: fixed; inset:0;
    display: none; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.45); backdrop-filter: blur(8px);
    z-index: 99999;
}
.modal-box {
    width: 92%; max-width: 520px;
    padding: 26px; border-radius: 14px;
    background: rgba(255,255,255,0.95);
    box-shadow: 0 18px 50px rgba(0,0,0,0.18);
    transform-origin: center;
    animation: modalPop .22s ease;
}
@keyframes modalPop { from { transform: translateY(8px) scale(.98); opacity:0 } to { transform: translateY(0) scale(1); opacity:1 } }
.modal-close { margin-top:16px; padding:10px 14px; border-radius:10px; background:#eee; border:none; cursor:pointer; }

/* -----------------------------------
   MOUSE TRAIL
----------------------------------- */
.trail {
    position: fixed; width:20px; height:20px; border-radius:50%;
    background: radial-gradient(circle, rgba(0,113,227,0.9), transparent 70%);
    pointer-events:none; filter: blur(6px); z-index: 99999; opacity:0.9;
    transition: transform .12s ease-out, opacity .25s;
}

/* -----------------------------------
   UTILITY & RESPONSIVE
----------------------------------- */
.text-center { text-align:center; }
.mb-12 { margin-bottom: 12px; }
@media (max-width: 980px) {
    .hero-title { font-size: 2.1rem; }
    .portal-container { grid-template-columns: 1fr; padding: 0 12px; gap: 18px; }
    .portal-sidebar { flex-direction: row; overflow-x:auto; white-space:nowrap; padding:10px; gap:8px; }
    .portal-sidebar a { margin-right: 8px; margin-bottom: 0; }
    .container { padding-top: 28px; padding-bottom: 28px; }
}
@media (max-width: 520px) {
    .hero-title { font-size: 1.6rem; }
    .hero-box { padding: 18px; }
    .modal-box { padding: 18px; }
}

/* -----------------------------------
   DEBUG (temporary, comment out if not needed)
----------------------------------- */
/* .portal-container { outline: 2px dashed rgba(255,0,0,0.08); }
.portal-sidebar { outline: 2px dashed rgba(0,128,0,0.08); }
.portal-content { outline: 2px dashed rgba(0,0,255,0.04); } */
