/* =========================================
   1. VARIABLES & GLOBAL RESET
   ========================================= */
:root {
    --primary-blue: #007AFF;
    --utar-blue: #0f1c3f;
    --utar-red: #d62d2d;
    --utar-green: #34c759;
    --utar-orange: #ff9500;
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --text-main: #1d1d1f;
    --text-secondary: #86868b;
    --radius-lg: 24px;
    --radius-sm: 12px;
    --nav-height: 70px;
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    min-height: 100vh;
    background-color: #f5f5f7;
    color: var(--text-main);
}

a { text-decoration: none; color: var(--primary-blue); transition: all 0.2s; }
ul { list-style: none; }

.background-mesh {
    position: fixed; /* Fixed is faster than absolute for backgrounds */
    top: -10%;       /* Oversize slightly to prevent white edges on bounce */
    left: -10%;
    width: 120%;
    height: 120%;
    z-index: -99;
    background: radial-gradient(circle at 10% 20%, rgb(239, 246, 255) 0%, rgb(219, 228, 255) 90%);
    
    /* PERFORMANCE FIXES */
    will-change: transform; /* Tells browser to prep for movement */
    backface-visibility: hidden; /* Hides jagged edges */
    transform: translateZ(0); /* Hack to trigger Hardware Acceleration */
}

/* Update the pseudo-element too */
.background-mesh::before {
    content: ''; 
    position: absolute; 
    top: 0; left: 0; 
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(0,122,255,0.08) 0%, transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(52, 199, 89, 0.06) 0%, transparent 50%);
    filter: blur(80px);
    
    /* Remove the CSS animation here if it conflicts with JS, 
       or keep it simple. If it's still laggy, delete the animation line below */
    /* animation: floatMesh 20s ease-in-out infinite; */ 
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

/* =========================================
   2. LOGIN PAGE STYLES (Restored)
   ========================================= */
.main-container {
    min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px;
}

/* Special Wrapper for Login Layout */
.glass-card.login-layout {
    display: flex; width: 1000px; max-width: 100%; overflow: hidden;
}

.login-section {
    flex: 1.2; padding: 60px; display: flex; flex-direction: column; justify-content: center;
}

.brand-header { margin-bottom: 40px; display: flex; align-items: center; gap: 15px; }
.logo { height: 65px; width: auto; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); object-fit: contain; }
.brand-text h1 { font-size: 24px; font-weight: 600; color: var(--text-main); }
.brand-text p { font-size: 14px; color: var(--text-secondary); }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.input-group input {
    width: 100%; padding: 16px; border-radius: var(--radius-sm); border: 1px solid #d2d2d7;
    background: rgba(255, 255, 255, 0.8); font-size: 16px; transition: all 0.2s ease;
}
.input-group input:focus { outline: none; border-color: var(--primary-blue); box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1); background: #fff; transform: scale(1.01); }

.btn-primary {
    width: 100%; padding: 16px; background: var(--primary-blue); color: white; border: none;
    border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; margin-top: 20px;
}
.btn-primary:hover { background: #0062cc; }

.help-text { margin-top: 20px; text-align: center; font-size: 13px; }
.separator { margin: 0 5px; color: #d2d2d7; }

/* Login Sidebar (Right Side) */
.links-section {
    flex: 0.8; background: rgba(255, 255, 255, 0.5); padding: 60px 40px;
    border-left: 1px solid rgba(255, 255, 255, 0.5); display: flex; flex-direction: column;
}
.links-section h2 { font-size: 18px; margin-bottom: 25px; color: var(--text-main); }
.link-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.quick-link {
    display: flex; align-items: center; padding: 12px 16px; background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm); color: var(--text-main); font-size: 14px; font-weight: 500;
    transition: all 0.2s; position: relative; overflow: hidden;
}
.quick-link:hover { background: white; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.quick-link .icon { margin-right: 12px; font-size: 18px; }
.quick-link.warning .icon { filter: grayscale(100%) sepia(100%) saturate(1000%) hue-rotate(-50deg); }
.footer-legal { margin-top: auto; font-size: 11px; color: var(--text-secondary); line-height: 1.5; padding-top: 40px; }

/* =========================================
   3. RECAPTCHA STYLES (Fixed)
   ========================================= */
.recaptcha-mock {
    display: flex; align-items: center; justify-content: space-between;
    background: #fff; border: 1px solid #d3d3d3; padding: 0 12px; border-radius: 4px;
    width: 280px; height: 74px; margin-bottom: 20px; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    user-select: none; cursor: pointer; transition: all 0.3s ease;
}
.recaptcha-mock.loading { border-color: #ccc; pointer-events: none; }
.recaptcha-mock.success { border-color: #00A36C; }

.recaptcha-content-left { display: flex; align-items: center; gap: 12px; }
.checkbox-box { width: 24px; height: 24px; border: 2px solid #c1c1c1; border-radius: 2px; background: #fff; }
#recaptcha-text { font-family: Roboto, Arial, sans-serif; font-size: 14px; color: #282828; font-weight: 500; }
.recaptcha-logo { display: flex; flex-direction: column; align-items: center; margin-left: auto; }
.terms-text { font-size: 10px; color: #555; margin-top: 2px; }
.terms-links { font-size: 8px; color: #999; }

.spinner {
    width: 24px; height: 24px; border: 3px solid #e0e0e0; border-top: 3px solid #4A90E2;
    border-radius: 50%; animation: spin 1s linear infinite; display: none; margin-right: 12px;
}
.checkmark {
    width: 26px; height: 26px; color: #00A36C; display: none; margin-right: 12px;
    animation: popCheck 0.4s cubic-bezier(0.65, 0, 0.45, 1);
}

/* =========================================
   4. NEW DASHBOARD & BILLING STYLES
   ========================================= */
/* Nav Bar */
.glass-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--glass-border); z-index: 100; display: flex; justify-content: center;
}
.nav-container { width: 1200px; max-width: 95%; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text-main); font-size: 20px; }
.nav-logo img { height: 40px; width: auto; border-radius: 8px; }
.nav-links { display: flex; gap: 5px; height: 100%; align-items: center; }
.nav-link { padding: 8px 16px; color: var(--text-main); font-weight: 500; font-size: 14px; border-radius: var(--radius-sm); }
.nav-link:hover, .nav-link.active { background: rgba(0,0,0,0.05); color: var(--primary-blue); }

/* Dropdowns */
.nav-dropdown { position: relative; height: 100%; display: flex; align-items: center; }
.dropdown-menu {
    position: absolute; top: 60px; left: 0; min-width: 220px; background: rgba(255, 255, 255, 0.95);
    padding: 10px; opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1); border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1); border: 1px solid rgba(255,255,255,0.5);
}
.nav-dropdown.active .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a { display: block; padding: 10px 14px; color: var(--text-main); font-size: 14px; border-radius: 8px; }
.dropdown-menu a:hover { background: var(--primary-blue); color: white; }

.nav-user { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.user-name { font-weight: 600; }
.btn-logout { padding: 8px 16px; background: rgba(0,0,0,0.05); color: var(--text-secondary); border-radius: 20px; font-weight: 500; }
.btn-logout:hover { background: #ffe5e5; color: var(--utar-red); }

/* Dashboard Grid */
.dashboard-container, .container { max-width: 1200px; margin: calc(var(--nav-height) + 30px) auto 50px; padding: 0 20px; }

.welcome-banner {
    padding: 30px 40px; margin-bottom: 30px;
    background: linear-gradient(to right, rgba(255,255,255,0.7), rgba(230, 240, 255, 0.5));
}
.welcome-banner h1 { font-size: 28px; margin-bottom: 5px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 25px; align-items: start; }
.dashboard-card { padding: 25px; transition: transform 0.2s; margin-bottom: 25px; }
.dashboard-card:hover { transform: translateY(-5px); }

.card-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-header .icon { font-size: 24px; }
.card-header h3 { font-size: 18px; font-weight: 600; }
.view-all { margin-left: auto; font-size: 13px; }
.card-list li { margin-bottom: 12px; }
.card-list li a { color: var(--text-main); font-size: 15px; display: flex; align-items: center; justify-content: space-between; }
.card-list li a:hover { color: var(--primary-blue); padding-left: 5px; }

/* Special Cards */
.alert-card {
    background: linear-gradient(to bottom right, rgba(255,255,255,0.9), rgba(255, 245, 240, 0.8));
    border-color: rgba(255, 149, 0, 0.3);
}

.billing-quick-view {
    display: flex;
    align-items: center;       /* Vertically center the text and badge */
    justify-content: flex-start; /* Keep them to the left */
    gap: 15px;                 /* <--- THIS FIXES THE COLLISION */
    margin: 20px 0;
}

.billing-quick-view .amount {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;    /* Tighter, Apple-like number spacing */
    color: var(--text-main);
}

.btn-card-action {
    display: flex;
    justify-content: center;   /* Center text inside button */
    width: 100%;               /* Force full width */
    padding: 12px 0;
    background: var(--text-main);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.btn-card-action:hover {
    background: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Announcements */
.announcement-card { padding: 0; }
.announcement-card .card-header { padding: 25px 25px 15px; margin-bottom: 0; }
.announcement-list { max-height: 500px; overflow-y: auto; }
.announcement-item { display: block; padding: 15px 25px; border-bottom: 1px solid rgba(0,0,0,0.05); transition: background 0.2s; }
.announcement-item:hover { background: rgba(255,255,255,0.5); }
.announcement-item .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.announcement-item .title { font-weight: 600; margin-bottom: 4px; line-height: 1.4; color: var(--text-main); }
.announcement-item .dept { font-size: 12px; color: var(--text-secondary); font-style: italic; }

/* Billing Page Specifics */
.portal-layout { display: flex; gap: 30px; }
.portal-sidebar { flex: 0 0 250px; padding: 30px 20px; height: fit-content; }
.portal-sidebar h3 { font-size: 14px; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 15px; letter-spacing: 1px; }
.sidebar-menu a { display: block; padding: 12px 15px; color: var(--text-main); border-radius: 8px; font-weight: 500; margin-bottom: 5px; }
.sidebar-menu a.active { background: white; color: var(--primary-blue); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

.portal-content { flex: 1; }
.content-padding { padding: 40px; }
.info-box { display: flex; gap: 15px; background: rgba(0, 122, 255, 0.08); padding: 20px; border-radius: 12px; margin-bottom: 30px; border: 1px solid rgba(0, 122, 255, 0.2); }
.info-box .icon { font-size: 24px; color: var(--primary-blue); }

/* --- FIXED BILLING TABLE --- */
.billing-table-container { 
    margin-bottom: 40px; 
    overflow-x: auto; /* Safety scroll for small screens */
}

/* New Column Ratios:
   1. Session (0.8fr)
   2. Type (1.5fr)
   3. Ref No (2.5fr) <-- WIDENED THIS
   4. Date (1.5fr)
   5. Status (0.8fr)
   6. Amount (1.5fr)
   7. Action (1.2fr)
*/
.billing-header-row { 
    display: grid; 
    grid-template-columns: 0.8fr 1.5fr 2.5fr 1.5fr 0.8fr 1.5fr 1.2fr; 
    padding: 15px 20px; 
    gap: 20px; /* <--- CRITICAL FIX */
    font-size: 11px; 
    font-weight: 700; 
    text-transform: uppercase; 
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.billing-data-row {
    display: grid; 
    grid-template-columns: 0.8fr 1.5fr 2.5fr 1.5fr 0.8fr 1.5fr 1.2fr;
    padding: 20px; 
    gap: 20px; /* <--- CRITICAL FIX */
    align-items: center; 
    background: rgba(255,255,255,0.7);
    transition: transform 0.2s, box-shadow 0.2s; 
    border-radius: 12px;
    margin-bottom: 10px;
}

.billing-data-row:hover { 
    transform: translateY(-2px); 
    background: #fff;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05); 
    z-index: 5;
}

.data-cell { 
    font-size: 14px; 
    font-weight: 500; 
    white-space: nowrap; /* Prevents text from squashing */
    overflow: hidden;
    text-overflow: ellipsis;
}

.amount-col { 
    text-align: right; 
    font-weight: 700; 
    font-size: 15px;
    letter-spacing: -0.5px;
}

.status-badge { 
    padding: 6px 12px; 
    border-radius: 20px; 
    font-size: 11px; 
    font-weight: 700; 
    text-align: center;
    display: inline-block;
}
.status-badge.success { background: #e1f7e6; color: var(--utar-green); }

.btn-pay-now {
    display: flex; 
    align-items: center; 
    justify-content: center;
    gap: 8px; 
    border: none; 
    background: linear-gradient(to bottom, #d12026, #a8181d);
    color: white; 
    padding: 10px 16px; 
    border-radius: 8px; 
    font-weight: 600; 
    cursor: pointer; 
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(209, 32, 38, 0.25);
    transition: all 0.2s;
    width: 100%;
}

.btn-pay-now:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(209, 32, 38, 0.4);
}

/* =========================================
   5. ANIMATIONS & RESPONSIVE
   ========================================= */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.animate-enter { opacity: 0; animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
.delay-1 { animation-delay: 0.1s; } .delay-2 { animation-delay: 0.2s; } .delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; } .delay-5 { animation-delay: 0.5s; }

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes popCheck { 0% { transform: scale(0); } 80% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% {transform: translateX(0);} 25% {transform: translateX(-5px);} 75% {transform: translateX(5px);} }

@media (max-width: 850px) {
    .glass-card.login-layout { flex-direction: column; width: 100%; margin: 20px; }
    .links-section { border-left: none; border-top: 1px solid rgba(255,255,255,0.5); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .portal-layout { flex-direction: column; }
    .portal-sidebar { width: 100%; }
    .nav-links { display: none; } /* Mobile Menu would go here */
    .billing-header-row { display: none; }
    .billing-data-row { grid-template-columns: 1fr; text-align: center; gap: 15px; }
    .amount-col { text-align: center; }
    .btn-pay-now { width: 100%; justify-content: center; }
}
/* =========================================
   6. PROFILE PAGE STYLES
   ========================================= */

.profile-top-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
}
.btn-edit-profile {
    padding: 8px 16px; border: 1px solid var(--glass-border); background: white;
    border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text-main);
    transition: all 0.2s;
}
.btn-edit-profile:hover { background: var(--primary-blue); color: white; border-color: transparent; }

/* Wrapper for Details + Photo */
.profile-section-wrapper {
    display: flex; gap: 40px;
}

.profile-data-grid { flex: 1; }

.section-title {
    font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-secondary);
    margin-bottom: 20px; font-weight: 700; border-bottom: 1px solid rgba(0,0,0,0.05); padding-bottom: 10px;
}

/* Key-Value Data Rows */
.data-row {
    display: grid; grid-template-columns: 140px 1fr;
    margin-bottom: 15px; align-items: flex-start;
}
.data-row .label { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.data-row .value { font-size: 15px; color: var(--text-main); font-weight: 600; line-height: 1.5; }
.data-row .value.highlight { color: var(--primary-blue); font-family: monospace; font-size: 16px; letter-spacing: 0.5px; }

/* Photo Frame */
.profile-photo-container {
    flex: 0 0 180px; display: flex; justify-content: center;
}
.photo-frame {
    width: 150px; height: 190px;
    background: white;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transform: rotate(2deg); /* Subtle playful rotation */
    border-radius: 4px;
}
.photo-placeholder {
    width: 100%; height: 100%; background: #f0f0f5;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; font-weight: 600; font-size: 12px; text-transform: uppercase;
    border: 1px dashed #d1d1d6;
}

/* Divider */
.profile-divider { border: 0; height: 1px; background: rgba(0,0,0,0.05); margin: 30px 0; }

/* Address Section */
.address-grid-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
.address-text {
    font-size: 15px; line-height: 1.6; color: var(--text-main); margin-bottom: 15px;
}
.address-text.text-muted { color: var(--text-secondary); font-style: italic; }

.contact-row { display: flex; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.contact-row .label { color: var(--text-secondary); width: 60px; }
.contact-row .value { font-weight: 600; }

/* Responsive Profile */
@media (max-width: 850px) {
    .profile-section-wrapper { flex-direction: column-reverse; } /* Photo on top on mobile */
    .profile-photo-container { justify-content: flex-start; margin-bottom: 20px; }
    .address-grid-layout { grid-template-columns: 1fr; gap: 30px; }
    .data-row { grid-template-columns: 1fr; gap: 5px; } /* Stack Label/Value on mobile */
    .data-row .label { font-size: 12px; }

/* =========================================
   7. TIMETABLE & POPUP STYLES (FINAL UNIFIED)
   ========================================= */

/* --- A. SESSION SELECTION --- */
.selection-header, .selection-row {
    display: grid; 
    grid-template-columns: 0.5fr 1fr 2fr 1fr 1fr;
    padding: 15px 20px; 
    gap: 15px; 
    align-items: center;
}
.selection-header {
    font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-secondary);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.selection-row {
    background: white; border-radius: 12px; margin-top: 10px;
    transition: transform 0.2s;
}
.selection-row:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }


/* --- B. THE TIMETABLE GRID (30-min Intervals) --- */
.timetable-scroll-wrapper {
    overflow-x: auto; margin-bottom: 30px; background: white; border-radius: 8px; padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.tt-grid {
    display: grid;
    /* 1st col (Days) = 60px.  Next 24 cols = 30min slots (min width 60px each) */
    grid-template-columns: 60px repeat(24, minmax(60px, 1fr)); 
    grid-auto-rows: minmax(50px, auto);
    gap: 1px;
    background: #e5e5e5; /* Creates grid lines via gap */
    border: 1px solid #e5e5e5;
}

/* Headers */
.tt-head, .tt-head-corner {
    background: #5D9CEC; /* Blue Header */
    color: white; font-weight: 700; font-size: 12px; text-align: center;
    padding: 8px 0; display: flex; align-items: center; justify-content: center;
}
.tt-head { grid-column: span 2; /* Spans 1 hour */ }

/* Days */
.tt-day {
    background: #FDFD96; /* Yellow Day */
    color: #333; font-weight: 700; font-size: 12px;
    display: flex; align-items: center; justify-content: center;
}

/* Slots */
.tt-slot.empty { background: white; }

/* Course Blocks */
.tt-block {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; font-size: 10px; line-height: 1.3;
    padding: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.tt-block strong { font-size: 11px; display: block; margin-bottom: 2px; }
.red-text { color: red; font-weight: 700; }

.lecture { background: #E3F2DA; border: 1px solid #cce5c0; }
.tutorial { background: #DAF0F2; border: 1px solid #c0e3e5; }


/* --- C. BOTTOM LIST TABLE --- */
.list-header-row {
    display: grid; 
    grid-template-columns: 40px 100px 3fr 50px 60px 100px 60px 200px 50px;
    gap: 15px; padding: 15px 20px; font-weight: 700; font-size: 11px; 
    background: #5D9CEC; color: white;
    text-transform: uppercase; text-align: center;
}
.list-header-row > div { display: flex; align-items: center; justify-content: center; }
.list-header-row > div:nth-child(2), 
.list-header-row > div:nth-child(3) { justify-content: flex-start; text-align: left; }

.list-data-row {
    display: grid; 
    grid-template-columns: 40px 100px 3fr 50px 60px 100px 60px 200px 50px;
    gap: 15px; padding: 15px 20px; font-size: 12px; 
    border-bottom: 1px dashed #ccc; align-items: flex-start; text-align: center;
    background: white;
}
.list-data-row > div:nth-child(2), 
.list-data-row > div:nth-child(3) { text-align: left; }

.list-data-row a { text-decoration: none; color: #007AFF; font-weight: 600; }
.link-cell { color: #007AFF; cursor: pointer; text-decoration: underline; }


/* --- D. MAC WINDOW POPUP (New) --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Dark dim */
    backdrop-filter: blur(5px);      /* Blur background */
    z-index: 9999;
    
    /* Animation Setup */
    visibility: hidden; opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    
    display: flex; justify-content: center; align-items: center;
}

/* Open State */
.modal-overlay.open {
    visibility: visible; opacity: 1; pointer-events: auto;
}

.mac-window {
    width: 650px; max-width: 90%; 
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
    overflow: hidden; 
    border: 1px solid rgba(0,0,0,0.1);
    
    /* Pop-In Animation */
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .mac-window {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Mac Window Internals */
.mac-title-bar {
    background: #efefef; height: 38px; display: flex; align-items: center;
    padding: 0 15px; border-bottom: 1px solid #dcdcdc; position: relative;
}
.traffic-lights { display: flex; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.red { background: #ff5f56; border: 1px solid #e0443e; cursor: pointer; }
.dot.yellow { background: #ffbd2e; border: 1px solid #dea123; }
.dot.green { background: #27c93f; border: 1px solid #1aab29; }

.window-title {
    position: absolute; left: 0; right: 0; text-align: center;
    font-weight: 600; font-size: 13px; color: #444; pointer-events: none;
}

.mac-body { padding: 30px 40px; }

.data-row-modal { display: grid; grid-template-columns: 140px 1fr; margin-bottom: 8px; font-size: 14px; }
.data-row-modal .label { font-weight: 700; color: #000; }
.data-row-modal .value { color: #333; }

.btn-close-preview {
    display: block; width: 100%; margin-top: 25px; padding: 12px;
    background: #f5f5f7; color: #333; border: 1px solid #d1d1d6;
    border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn-close-preview:hover { background: #e5e5ea; border-color: #c7c7cc; }
