/*====================================================
NIHARIKA ONLINE LEARNING MEDIA
COMPLETE STYLE.CSS - COMPACT / REDUCED HEIGHT
====================================================*/

/*=============================
1. RESET & BASE STYLES
=============================*/
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: Arial, Helvetica, sans-serif; background: #f4f7fb; color: #333; line-height: 1.5; } /* Tighter line-height */

/*=============================
2. TOP-RIGHT AUTH BUTTONS
=============================*/
.top-right-auth { position: absolute; top: 10px; right: 20px; display: flex; gap: 8px; align-items: center; z-index: 100; }
.auth-btn { background: #ffffff; color: #0b3b60; padding: 5px 12px; font-size: 0.8rem; font-weight: bold; text-decoration: none; border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); transition: 0.2s; white-space: nowrap; }
.auth-btn:hover { background: #f1f5f9; transform: translateY(-1px); }
.auth-btn.portal { background: #f59e0b; color: #ffffff; }
.auth-btn.portal:hover { background: #d97706; }

/*=============================
3. HEADER SECTION
=============================*/
.site-header { display: flex; align-items: center; justify-content: flex-start; gap: 15px; background: #ffffff; padding: 8px 20px; border-bottom: 3px solid #0d47a1; box-shadow: 0 2px 6px rgba(0,0,0,.08); position: relative; }
.logo-area img { width: 80px; height: 80px; display: block; } /* Reduced Logo Size */
.title-area { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; text-align: left; }
.title-area h1 { margin: 0; font-size: 42px; font-weight: 700; color: #e53935; letter-spacing: 1px; line-height: 42px; text-transform: uppercase; } /* Reduced Font */
.title-area h2 { margin: 2px 0 0 2px; font-size: 18px; font-weight: 800; color: #1b2d8c; letter-spacing: 1px; text-transform: uppercase; }
.title-area h3 { margin: 2px 0 0 2px; font-size: 15px; font-weight: 500; color: #1b2d8c; font-style: italic; }
.title-area p { margin-top: 4px; font-size: 13px; color: #555; }

/*=============================
4. MARQUEE
=============================*/
marquee { background: #fff3cd; color: #c62828; font-weight: bold; padding: 8px; border-bottom: 1px solid #ffe082; font-size: 14px; }

/*=============================
5. NAVIGATION & DROPDOWNS
=============================*/
nav { background: #1565c0; display: flex; position: relative; overflow: visible; z-index: 50; }
nav > a, .menu > a { display: block; padding: 12px 20px; color: #fff; text-decoration: none; font-weight: bold; transition: .3s; white-space: nowrap; font-size: 15px; } /* Reduced Padding */
nav > a:hover, .menu > a:hover { background: #0d47a1; }
.menu { position: relative; }

.dropdown { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border-radius: 0 0 8px 8px; box-shadow: 0 8px 20px rgba(0,0,0,.2); z-index: 999; }
.menu:hover > .dropdown { display: block; }
.dropdown a { display: block; padding: 10px 16px; color: #333; text-decoration: none; background: #fff; transition: .3s; font-size: 14px; }
.dropdown a:hover { background: #1565c0; color: #fff; }
.dropdown hr { border: none; border-top: 1px solid #ddd; margin: 5px 0; }

.submenu { position: relative; }
.submenu > a { font-weight: 600; }
.submenu > a::after { content: "▶"; float: right; font-size: 10px; margin-top: 4px; }
.submenu-content { display: none; position: absolute; top: 0; left: 100%; min-width: 200px; background: #fff; border-radius: 6px; box-shadow: 0 8px 20px rgba(0,0,0,.25); z-index: 9999; }
.submenu:hover > .submenu-content { display: block; }

/*=============================
6. LAYOUT CONTAINERS & GRID
=============================*/
.container { max-width: 1200px; margin: auto; padding: 15px; } /* Reduced padding */

.card { background: #fff; border-radius: 8px; padding: 15px; margin-bottom: 20px; box-shadow: 0 4px 10px rgba(0,0,0,.05); } /* Reduced card padding/margin */

.content-section { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; align-items: stretch; margin-bottom: 20px; } /* Tighter grid gaps */
.features, .updates-box { max-width: 100%; width: 100%; margin-bottom: 0; }

/*=============================
7. FLOW CHART UI
=============================*/
.flow { display: flex; gap: 10px; align-items: center; overflow-x: auto; padding: 10px 0; }
.flow::-webkit-scrollbar { height: 6px; }
.flow::-webkit-scrollbar-thumb { background: #1565c0; border-radius: 20px; }
.box { min-width: 140px; background: #e3f2fd; border: 2px solid #1565c0; color: #0d47a1; border-radius: 6px; padding: 10px; text-align: center; font-weight: bold; flex-shrink: 0; font-size: 14px; }
.arrow { font-size: 22px; color: #1565c0; font-weight: bold; }

/*=============================
8. WEEKLY TOPIC CARD (Height Severely Reduced)
=============================*/
.weekly-topic-card { padding: 0; overflow: hidden; }
.weekly-header { position: relative; height: 160px; } /* Reduced from 220px to 160px */
.weekly-image { width: 100%; height: 100%; object-fit: cover; }
.header-overlay { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 15px; background: linear-gradient(rgba(0,0,0,.2), rgba(0,0,0,.8)); }
.header-overlay h2 { color: #ff0000; font-size: 26px; margin: 0; } /* Reduced text size */
.episode-details { background: rgba(255,255,255,.2); backdrop-filter: blur(8px); color: #fff; padding: 8px 12px; border-radius: 6px; line-height: 1.4; text-align: right; font-size: 13px; }
.episode-details strong { color: #ffd54f; }

.weekly-content { padding: 15px; } /* Reduced from 25px */
.weekly-class { display: inline-block; background: #ff9800; color: #fff; padding: 4px 12px; border-radius: 15px; font-size: 12px; font-weight: bold; }
.weekly-content h3 { color: #0d47a1; margin: 10px 0; font-size: 22px; } /* Reduced margins and text */
.weekly-content p { color: #555; margin-bottom: 10px; font-size: 14px; line-height: 1.4; }
.weekly-content ul { margin-left: 20px; font-size: 14px; }
.weekly-content li { margin: 4px 0; }

.weekly-buttons { display: flex; gap: 10px; margin-top: 15px; } /* Reduced gap and margin */
.weekly-buttons a { flex: 1; text-align: center; text-decoration: none; color: #fff; padding: 10px; border-radius: 4px; font-weight: bold; transition: .3s; font-size: 14px; }
.continue-btn { background: #2e7d32; } .continue-btn:hover { background: #1b5e20; }
.test-btn { background: #1565c0; } .test-btn:hover { background: #0d47a1; }
.archive-btn { background: #6f42c1; } .archive-btn:hover { background: #ef6c00; }

.weekly-footer { margin-top: 15px; padding: 10px; background: #f5f5f5; border-top: 1px solid #ddd; text-align: right; font-style: italic; font-size: 13px; }
.weekly-footer strong { color: #0d47a1; }

/*=============================
9. LATEST UPDATES (Height Reduced)
=============================*/
.updates-box h2, .features h2 { margin-bottom: 10px; color: #0d47a1; font-size: 20px; margin-top: 0; }
.scroll-box { height: 220px; overflow: hidden; position: relative; } /* Reduced from 330px to 220px */
@keyframes scrollUp { 0% { top: 100%; } 100% { top: -100%; } }
.scroll-content { position: absolute; width: 100%; animation: scrollUp 15s linear infinite; }
.scroll-content p { background: #f8f9fa; border-left: 3px solid #1565c0; padding: 8px; margin: 6px; border-radius: 4px; font-size: 13px; }
.scroll-box:hover .scroll-content { animation-play-state: paused; }

/*=============================
10. OUR FEATURES LIST (Height Reduced)
=============================*/
.features ul { list-style: none; }
.features li { padding: 8px 0; border-bottom: 1px solid #eee; font-size: 15px; } /* Reduced padding & font */

/*=============================
11. TABLES & FORMS
=============================*/
table { width: 100%; border-collapse: collapse; margin: 15px 0; }
table th { background: #1565c0; color: #fff; padding: 10px; font-size: 14px; }
table td { padding: 10px; border: 1px solid #ddd; font-size: 14px; }
table tr:nth-child(even) { background: #f8f8f8; }

input, select, textarea { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; margin-top: 4px; margin-bottom: 10px; font-size: 14px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #1565c0; box-shadow: 0 0 5px rgba(21,101,192,.3); }

button { background: #1565c0; color: #fff; border: none; padding: 10px 20px; border-radius: 4px; cursor: pointer; transition: .3s; font-size: 14px; }
button:hover { background: #0d47a1; }

/*=============================
12. FOOTER
=============================*/
.footer { background: #0d47a1; color: #fff; text-align: center; padding: 15px; font-size: 14px; } /* Reduced padding */
.footer a { color: #fff; text-decoration: none; margin: 0 8px; }
.footer a:hover { text-decoration: underline; }

/*=============================
13. RESPONSIVE QUERIES
=============================*/
@media (max-width: 992px) {
    .content-section { grid-template-columns: 1fr; gap: 15px; }
}

@media (max-width: 768px) {
    /* --- HEADER & AUTH BUTTON FIXES --- */
    .top-right-auth { 
        position: static; 
        display: flex; /* Added: Enables flex properties to work */
        width: 100%; 
        justify-content: center; 
        background: #0b3b60; 
        padding: 10px; /* Increased slightly for better tap targets */
        flex-wrap: wrap; 
        gap: 10px; /* Added: Prevents buttons from touching each other */
        box-sizing: border-box; /* Added: Keeps padding inside screen limits */
    }
    
    .auth-btn { 
        font-size: 0.85rem; /* Increased slightly for readability */
        padding: 8px; 
        flex: 1 1 auto; /* Added: Allows buttons to size dynamically */
        text-align: center;
    }
    
    .site-header { flex-direction: column; align-items: center; text-align: center; padding: 10px; }
    .logo-area img { width: 60px; height: auto; }
    .title-area { align-items: center; text-align: center; }
    .title-area h1 { font-size: 28px; line-height: 28px; }
    .title-area h2 { font-size: 13px; margin-top: 4px; }
    .title-area h3 { font-size: 11px; margin-top: 2px; }
    .title-area p { display: none; }

    /* --- CONTENT OVERFLOW FIX --- */
    /* Added this block to ensure no inner elements overflow the screen */
    .content-section * {
        box-sizing: border-box;
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    /* --- NAVIGATION FIXES --- */
    nav { display: block; width: 100%; }
    nav > a, .menu > a { 
        display: block; /* Added: Ensures full-width touch areas */
        border-bottom: 1px solid rgba(255,255,255,.2); 
        padding: 12px 15px; /* Adjusted to make the menu slightly more compact */
    }
    .menu { width: 100%; }
    
    .dropdown, .submenu-content { position: static; display: none; width: 100%; box-shadow: none; border-radius: 0; }
    .menu:hover > .dropdown, .submenu:hover > .submenu-content { display: block; }
    .submenu-content a { padding-left: 30px; }

    .weekly-buttons { flex-direction: column; }
    .weekly-buttons a { width: 100%; box-sizing: border-box; }
    .header-overlay { flex-direction: column; align-items: flex-start; justify-content: flex-end; }
    .episode-details { width: 100%; text-align: left; margin-top: 5px; box-sizing: border-box; }
}

@media (max-width: 480px) {
    /* --- SHRINK AUTH BUTTONS FURTHER --- */
    .top-right-auth { 
        padding: 6px 4px; 
        gap: 5px; /* Tighter spacing between buttons */
    }
    .auth-btn { 
        font-size: 0.70rem; /* Dropped slightly to help narrow the button */
        padding: 5px 6px; /* Reduces bulk on tiny screens */
        flex: 0 1 auto; /* Stops the buttons from stretching to fill empty space */
        min-width: unset; /* Removes any minimum width restrictions */
        width: max-content; /* Forces the button to wrap tightly around its text */
    }

    /* --- COMPACT HEADER --- */
    .site-header { padding: 8px 5px; }
    .logo-area img { width: 50px; }
    
    .title-area h1 { font-size: 22px; line-height: 24px; } 
    .title-area h2 { font-size: 11px; margin-top: 3px; }
    .title-area h3 { font-size: 10px; margin-top: 2px; }
    
    /* --- COMPACT NAVIGATION --- */
    nav > a, .menu > a { 
        padding: 10px; 
        font-size: 14px; 
    }

    /* --- MISC --- */
    marquee { font-size: 12px; padding: 6px; }
}
/* Target mobile screens (adjust the 768px breakpoint if needed) */
@media screen and (max-width: 768px) {
  
  /* The main container holding both the Logo and the Buttons */
  .your-header-container-class {
    display: flex;
    flex-direction: column-reverse; /* This flips the visual order, putting buttons on top */
    align-items: center; /* Centers everything horizontally */
    padding-top: 15px; 
  }

  /* The container holding the three buttons */
  .your-button-container-class {
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Ensures buttons wrap to the next line if they are too wide */
    gap: 10px; /* Adds space between the buttons */
    margin-bottom: 15px; /* Adds space between the buttons and the logo below */
    
    /* If the buttons currently have absolute positioning, reset it here */
    position: relative; 
    top: 0;
    right: 0;
  }
  
  /* Optional: Adjust logo margin for better spacing */
  .your-logo-class {
    margin-top: 10px;
  }
}