/* ==========================================
   MSNS About Page Custom Section Styling
   File: about.css (Red & Gold Theme)
   ========================================== */

/* ==========================================================
   1. DATA GRID LAYOUT (Students & Teachers Cards)
   ========================================================== */
.msns-data-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
    gap: 18px !important;
    margin-top: 20px !important;
    margin-bottom: 25px !important;
    width: 100% !important;
}

/* Common Card Design for both Students & Teachers */
.msns-custom-card {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 18px !important;
    padding: 20px !important;
    color: #0f172a !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
}

.msns-custom-card:hover {
    transform: translateY(-4px) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(185, 28, 28, 0.35) !important;
    box-shadow: 0 12px 28px rgba(185, 28, 28, 0.15) !important;
}

/* Card Header Badge */
.card-head-badge {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
}

.card-head-badge h3 {
    margin: 0 !important;
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #b91c1c !important;
    letter-spacing: 0.3px !important;
}

/* Card Stats Rows */
.card-body-content {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.stat-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    font-size: 0.9rem !important;
}

.stat-label {
    color: #52525b !important;
    font-weight: 500 !important;
}

.stat-val {
    font-weight: 700 !important;
    font-size: 0.98rem !important;
    padding: 2px 10px !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.04) !important;
}

/* Specific Values Coloring */
.girls-color { color: #db2777 !important; }
.boys-color  { color: #b91c1c !important; }
.total-color { color: #16a34a !important; }
.avg-color   { color: #d97706 !important; }

.total-row {
    margin-top: 6px !important;
    padding-top: 8px !important;
    border-top: 1px dashed rgba(0, 0, 0, 0.12) !important;
}

.total-row .stat-label {
    color: #0f172a !important;
    font-weight: 600 !important;
}

/* ==========================================================
   2. PDF BUTTONS (Fixed & Clickable)
   ========================================================== */

/* PDF Button Wrapper — Center align (Back-to-Top සමඟ ගැටෙන්නෙ නැති විදියට) */
.pdf-btn-wrapper,
.full-pdf-wrapper {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    position: relative !important;
    z-index: 10 !important;
    box-sizing: border-box !important;
    /* Padding එකෙන් දෙපැත්තෙන් space දෙනවා Back-to-Top එකට ගැටෙන්නෙ නැති විදියට */
    padding: 0 70px !important;
}

.pdf-btn-wrapper {
    margin: 15px 0 35px 0 !important;
}

.full-pdf-wrapper {
    margin-top: 25px !important;
    margin-bottom: 25px !important;
}

/* Common PDF Button Base */
.pdf-download-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 12px 28px !important;
    border-radius: 30px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 20 !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease !important;
    /* Red gradient (school theme) */
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    color: #ffffff !important;
    /* Gold accent border */
    border: 1px solid rgba(234, 179, 8, 0.35) !important;
    box-shadow: 0 6px 20px rgba(185, 28, 28, 0.4) !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

.pdf-download-btn:hover {
    transform: translateY(-2px) scale(1.03) !important;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    box-shadow: 0 10px 25px rgba(185, 28, 28, 0.55) !important;
    color: #ffffff !important;
    border-color: rgba(234, 179, 8, 0.6) !important;
}

.pdf-download-btn:active {
    transform: translateY(-1px) scale(1) !important;
}

.pdf-download-btn svg {
    width: 20px !important;
    height: 20px !important;
    stroke: #ffffff !important;
    flex-shrink: 0 !important;
    fill: none !important;
}

/* Full PDF Special Styling (Gold theme) */
.full-pdf-btn {
    background: linear-gradient(135deg, #d97706, #f59e0b) !important;
    box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4) !important;
    padding: 14px 34px !important;
    font-size: 1.05rem !important;
    border: 1px solid rgba(185, 28, 28, 0.4) !important;
}

.full-pdf-btn:hover {
    background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
    box-shadow: 0 10px 25px rgba(217, 119, 6, 0.55) !important;
    border-color: rgba(185, 28, 28, 0.6) !important;
}

/* Loading & Fallback Text */
.msns-loading-text {
    text-align: center !important;
    color: #71717a !important;
    width: 100% !important;
    padding: 20px !important;
    grid-column: 1 / -1 !important;
    font-size: 0.95rem !important;
}

/* ==========================================================
   3. QUICK ACCESS / FAST OPEN TABS
   ========================================================== */
#quick-access {
    margin-bottom: 30px !important;
    width: 100% !important;
    display: block !important;
}

.quick-tabs-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
    gap: 16px !important;
    margin-top: 15px !important;
    width: 100% !important;
}

.quick-tab-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    border-radius: 16px !important;
    padding: 16px 18px !important;
    text-decoration: none !important;
    color: #0f172a !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

.quick-tab-card:hover {
    transform: translateY(-3px) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-color: rgba(185, 28, 28, 0.35) !important;
    box-shadow: 0 10px 25px -5px rgba(185, 28, 28, 0.15) !important;
}

/* Left Icon Box */
.tab-icon-wrap {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 12px !important;
    background: rgba(234, 179, 8, 0.15) !important;
    border: 1px solid rgba(234, 179, 8, 0.4) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: 15px !important;
    flex-shrink: 0 !important;
}

.tab-icon-wrap svg {
    width: 24px !important;
    height: 24px !important;
    stroke: #b45309 !important;
}

/* Middle Details */
.tab-details {
    flex: 1 1 auto !important;
    text-align: left !important;
}

.tab-details h3 {
    margin: 0 !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
}

.tab-details p {
    margin: 4px 0 0 0 !important;
    font-size: 0.8rem !important;
    color: #71717a !important;
    line-height: 1.2 !important;
}

/* Right Arrow Icon */
.tab-arrow {
    width: 28px !important;
    height: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.6 !important;
}

.tab-arrow svg {
    width: 18px !important;
    height: 18px !important;
    stroke: #52525b !important;
}

/* ==========================================================
   4. MSNS AI FLOATING WIDGET (Red & Gold Theme)
   ========================================================== */
.msns-ai-widget {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99999;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border: 1px solid rgba(185, 28, 28, 0.4);
    border-right: none;
    border-radius: 35px 0 0 35px;
    padding: 8px 12px 8px 14px;
    box-shadow: -6px 12px 30px rgba(185, 28, 28, 0.35),
                inset 0 1px 1px rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-family: 'Poppins', sans-serif;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    user-select: none;
}

/* ==========================================================
   5. RESPONSIVE — Mobile එකට PDF Button හරියට පෙන්නන්න
   ========================================================== */
@media (max-width: 480px) {
    /* Mobile එකේ Back-to-Top button එකට space එක අඩු නිසා padding එක අඩු කරනවා */
    .pdf-btn-wrapper,
    .full-pdf-wrapper {
        padding: 0 15px !important;
    }

    .pdf-download-btn,
    .full-pdf-btn {
        padding: 12px 22px !important;
        font-size: 0.9rem !important;
        width: auto !important;
        max-width: 100% !important;
    }

    .full-pdf-btn {
        padding: 13px 26px !important;
        font-size: 0.95rem !important;
    }
}
