/* =========================================
   CUBA THEME GLOBAL VARIABLES
   ========================================= */
:root {
    --primary: #7366ff;         /* Cuba Purple */
    --primary-light: #e2dfff;   /* Soft purple for backgrounds */
    --secondary: #f73164;       /* Cuba Pink/Red accent */
    --success: #51bb25;         /* Cuba Green */
    --bg-body: #f5f6fa;         /* Very soft gray background */
    --card-bg: #ffffff;
    --text-dark: #2b2b2b;       /* Soft black for headings */
    --text-muted: #898989;      /* Muted gray for subtitles */
    --border-color: #f1f3f9;    /* Ultra light borders */
    --radius-lg: 15px;          /* Cuba's signature rounded corners */
    --shadow-soft: 0 4px 20px rgba(8, 21, 66, 0.05); /* Diffuse shadow */
}

* { box-sizing: border-box; }

body {
    font-family: 'Rubik', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header styling */
header {
    padding: 20px 24px;
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1, header .studio-logo {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Main content area */
main {
    flex: 1;
    padding: 30px 20px 100px 20px; /* 100px clears the bottom nav */
    overflow-y: auto;
}

/* Skeleton Loaders (Cuba Style) */
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }
.skeleton-box {
    background: #f1f3f9;
    background-image: linear-gradient(to right, #f1f3f9 0%, #e2e5ef 20%, #f1f3f9 40%, #f1f3f9 100%);
    background-repeat: no-repeat;
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--radius-lg);
}

/* Bottom Navigation */
nav:not(.reader-nav) {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 12px 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(8, 21, 66, 0.05);
}

nav:not(.reader-nav) ul {
    list-style: none;
    margin: 0;
    padding: 0 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

nav:not(.reader-nav) a {
    text-decoration: none;
    font-size: 1.5rem;
    padding: 10px 20px;
    border-radius: 12px;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

/* Cuba Highlight for active tab */
nav:not(.reader-nav) a.active, nav:not(.reader-nav) a:hover {
    background-color: var(--primary-light); 
    color: var(--primary);
    transform: translateY(-2px);
}

/* =========================================
   TOP NAVIGATION NOTIFICATIONS (CUBA THEME)
   ========================================= */
.header-actions { display: flex; align-items: center; gap: 15px; }
.notification-wrapper { position: relative; }

.icon-btn { 
    background: var(--bg-body); border: none; width: 40px; height: 40px; 
    border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: 0.2s; 
    display: flex; align-items: center; justify-content: center; color: var(--text-dark); 
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); }

/* The Red Notification Dot */
.notif-badge { 
    position: absolute; top: -2px; right: -2px; background: var(--secondary); 
    color: white; font-size: 0.7rem; font-weight: bold; width: 18px; height: 18px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    border: 2px solid var(--card-bg); 
}

/* The Dropdown Box */
.notif-dropdown { 
    position: absolute; top: 55px; right: 0; width: 320px; 
    background: var(--card-bg); border-radius: var(--radius-lg); 
    box-shadow: 0 10px 30px rgba(8, 21, 66, 0.15); border: 1px solid var(--border-color); 
    z-index: 3000; overflow: hidden; display: flex; flex-direction: column; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); transform-origin: top right; 
}
.notif-dropdown.hidden { opacity: 0; transform: scale(0.95); pointer-events: none; }

.notif-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); background: #fdfdff; }
.notif-header h4 { margin: 0; color: var(--text-dark); font-size: 1rem; }

.notif-list { max-height: 350px; overflow-y: auto; padding: 10px 0; }
.notif-item { padding: 12px 20px; border-bottom: 1px solid var(--border-color); display: flex; gap: 12px; transition: 0.2s; }
.notif-item:hover { background: var(--bg-body); }
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 1.2rem; }
.notif-text h5 { margin: 0 0 4px 0; font-size: 0.95rem; color: var(--text-dark); }
.notif-text p { margin: 0 0 5px 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.notif-text small { font-size: 0.75rem; color: #cbd5e1; }

/* Mobile Centering Override */
@media (max-width: 600px) {
    .notif-dropdown { 
        position: fixed; top: 75px; left: 5%; width: 90%; right: auto; 
        transform-origin: top center;
    }
}
/* =========================================
   TOP NAVIGATION NOTIFICATIONS (CUBA THEME)
   ========================================= */
.header-actions { display: flex; align-items: center; gap: 15px; }
.notification-wrapper { position: relative; }

.icon-btn { 
    background: var(--bg-body); border: none; width: 40px; height: 40px; 
    border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: 0.2s; 
    display: flex; align-items: center; justify-content: center; color: var(--text-dark); 
}
.icon-btn:hover { background: var(--primary-light); color: var(--primary); }

/* The Red Notification Dot */
.notif-badge { 
    position: absolute; top: -2px; right: -2px; background: var(--secondary); 
    color: white; font-size: 0.7rem; font-weight: bold; width: 18px; height: 18px; 
    border-radius: 50%; display: flex; align-items: center; justify-content: center; 
    border: 2px solid var(--card-bg); 
}

/* The Dropdown Box */
.notif-dropdown { 
    position: absolute; top: 55px; right: 0; width: 320px; 
    background: var(--card-bg); border-radius: var(--radius-lg); 
    box-shadow: 0 10px 30px rgba(8, 21, 66, 0.15); border: 1px solid var(--border-color); 
    z-index: 3000; overflow: hidden; display: flex; flex-direction: column; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); transform-origin: top right; 
}
.notif-dropdown.hidden { opacity: 0; transform: scale(0.95); pointer-events: none; }

.notif-header { padding: 15px 20px; border-bottom: 1px solid var(--border-color); background: #fdfdff; }
.notif-header h4 { margin: 0; color: var(--text-dark); font-size: 1rem; }

.notif-list { max-height: 350px; overflow-y: auto; padding: 10px 0; }
.notif-item { padding: 12px 20px; border-bottom: 1px solid var(--border-color); display: flex; gap: 12px; transition: 0.2s; }
.notif-item:hover { background: var(--bg-body); }
.notif-item:last-child { border-bottom: none; }
.notif-icon { font-size: 1.2rem; }
.notif-text h5 { margin: 0 0 4px 0; font-size: 0.95rem; color: var(--text-dark); }
.notif-text p { margin: 0 0 5px 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.notif-text small { font-size: 0.75rem; color: #cbd5e1; }

/* Mobile Centering Override */
@media (max-width: 600px) {
    .notif-dropdown { 
        position: fixed; top: 75px; left: 5%; width: 90%; right: auto; 
        transform-origin: top center;
    }
}


/* =========================================
   SKELETON LOADERS (Latency Masking)
   ========================================= */
@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

.skeleton {
    background: #f6f7f8;
    background: linear-gradient(90deg, #eeeeee 8%, #dddddd 18%, #eeeeee 33%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 8px;
}

/* Feed Skeleton Layout */
.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px;
    background: white;
    border: 1px solid #f1f3f9;
    border-radius: 15px;
    margin-bottom: 15px;
}

.skeleton-img { width: 100%; height: 180px; border-radius: 10px; }
.skeleton-title { width: 80%; height: 24px; }
.skeleton-text { width: 100%; height: 16px; }
.skeleton-text.short { width: 60%; }