/* --- DESIGN TOKENS --- */
/* Centralizing the repeated colors/shadows used across every CSS file.
   Existing hex values are left in place elsewhere so nothing breaks,
   but new/edited rules below use these variables. */
:root {
    --blue-darkest: #1565c0;
    --blue-dark: #1e88e5;
    --blue-mid: #42a5f5;
    --blue-light: #64b5f6;
    --blue-bg: #e3f2fd;
    --blue-bg-soft: #f0f8ff;
    --blue-bg-softer: #f8fbff;

    --text-main: #333;
    --text-muted: #777;
    --text-faint: #999;
    --border-color: #e0e0e0;

    --danger: #dc3545;
    --success: #28a745;
    --warning: #ff9800;

    --shadow-sm: 0 2px 10px rgba(30, 136, 229, 0.15);
    --shadow-md: 0 5px 20px rgba(30, 136, 229, 0.1);
    --shadow-lg: 0 10px 25px rgba(30, 136, 229, 0.2);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;

    --header-height: 70px;
    --sidebar-width: 240px;
}

/* --- RESET & BASICS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

img { max-width: 100%; }

/* Default body for Login/Signup pages */
body {
    background-color: #e3f2fd; /* Light Blue Background */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #333;
}

/* --- DASHBOARD LAYOUT OVERRIDES --- */
.dashboard-body {
    display: block; /* Reset flex from default body */
    height: auto;
    min-height: 100vh;
    background-color: #f0f8ff; /* Slightly different background for dashboard */
}

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 70px); /* Full height minus header */
}

/*=============================================
=            LOGIN / SIGNUP STYLES            =
=============================================*/
.auth-card {
    background-color: #ffffff;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(30, 136, 229, 0.2); /* Soft Blue Shadow */
    text-align: center;
}

.auth-header h2 {
    color: #1565c0; /* Darker Blue */
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-header p {
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
}

.input-group {
    text-align: left;
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    color: #1e88e5; /* Medium Blue Label */
    font-weight: 600;
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: #42a5f5;
    background-color: #f0f8ff;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #42a5f5, #1e88e5); /* Blue Gradient */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 136, 229, 0.4);
}

.auth-link {
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.auth-link a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* --- PASSWORD VISIBILITY TOGGLE --- */
.password-field {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-field input {
    flex: 1;
    padding-right: 45px; /* Space for button */
}

.toggle-password-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    color: #1e88e5;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-password-btn:hover {
    opacity: 0.7;
}

.eye-icon {
    display: inline-block;
}

/*=============================================
=            DASHBOARD HEADER                 =
=============================================*/
.dashboard-header {
    background-color: #ffffff;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(30, 136, 229, 0.15);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    color: #1565c0;
}

.logo-icon {
    font-size: 28px;
    margin-right: 12px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #1565c0;
}

.header-right {
    display: flex;
    align-items: center;
}

.profile-link {
    text-decoration: none;
    color: #1e88e5;
    font-weight: 600;
    margin-right: 25px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.profile-link i {
    margin-right: 8px;
    font-size: 18px;
}

.profile-link:hover {
    color: #1565c0;
}

.btn-logout {
    padding: 8px 20px;
    background-color: #e3f2fd;
    color: #1565c0;
    border: 2px solid #1565c0;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-logout:hover {
    background-color: #1565c0;
    color: white;
}

/*=============================================
=            DASHBOARD SIDEBAR                =
=============================================*/
.sidebar {
    width: 240px;
    background-color: #ffffff;
    padding-top: 20px;
    border-right: 1px solid #e0e0e0;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    border-left: 4px solid transparent;
}

.nav-link i {
    margin-right: 15px;
    font-size: 18px;
    width: 24px; /* Fixed width for icon alignment */
    text-align: center;
    color: #999;
    transition: color 0.3s;
}

/* Hover State */
.nav-link:hover {
    background-color: #f0f8ff;
    color: #1e88e5;
}

.nav-link:hover i {
    color: #1e88e5;
}

/* Active State (for the current page) */
.sidebar {
    box-shadow: 5px 0 20px rgba(0,0,0,.05);
}

.nav-link {
    border-radius: 0 30px 30px 0;
    margin-right: 10px;
}

.nav-item.active .nav-link {
    box-shadow: 0 5px 15px rgba(30,136,229,.2);
}

/*=============================================
=            DASHBOARD CONTENT AREA           =
=============================================*/
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto; /* Allow scrolling if content is long */
}

/* Shared style for all cards in the content area */
.content-card {
    background-color: #ffffff;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 5px 20px rgba(30, 136, 229, 0.1);
    margin-bottom: 30px;
}

/* Specific styles for the Hero card */
.hero-card{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:55px 60px;
    border-radius:22px;
    background:linear-gradient(
        135deg,
        #1565c0,
        #42a5f5
        );
    color:white;
    box-shadow:0 15px 35px rgba(21,101,192,.25);
    margin-bottom:30px;
    overflow:hidden;
    position:relative;
    transition:.35s;
}       

.hero-card:hover{
    transform:translateY(-3px);
}

.hero-card::after{
    content:"";
    position:absolute;
    right:-40px;
    top:-40px;
    width:220px;
    height:220px;
    background:rgba(255,255,255,.08);
    border-radius:50%;
}

.hero-top{
    display:flex;
    justify-content:space-between;
    align-items:center;
    width:100%;
    gap:50px;
}

.hero-card h2{
    font-size:36px;
    margin-bottom:15px;
    font-weight:700;
}

.hero-intro{
    font-size:18px;
    opacity:.95;
    margin-bottom:15px;
}

.hero-content{
    flex:1;
    max-width:650px;
    z-index:2;
}

.hero-text{
    max-width:600px;
    line-height:1.8;
    opacity:.88;
    margin-bottom:30px;
}

.hero-actions{
    display:flex;
    gap:15px;
    margin-top:30px;
    flex-wrap:wrap;
}

.hero-image{
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
}

.hero-image i{
    font-size:110px;
    opacity:.20;
}

.hero-card::before{
    content:"";
    position:absolute;
    bottom:-70px;
    left:-70px;
    width:180px;
    height:180px;
    background:rgba(255,255,255,.06);
    border-radius:50%;
}

/* HERO BUTTONS */

.btn-action{
    background:#fff;
    color:#1565c0;
    padding:14px 26px;
    border-radius:12px;
    text-decoration:none;
    font-weight:600;
    transition:.3s;
}

.btn-action:hover{
    background:#f7fbff;
    transform:translateY(-3px);
    box-shadow:0 10px 25px rgba(255,255,255,.2);
}

/* Renamed from .btn-secondary: that name was also defined in components.css
   as a solid gray button, and whichever stylesheet loaded last silently
   overrode the hero card's transparent/outline look. */
.btn-hero-outline{
    background:transparent;
    color:white;
    border:2px solid rgba(255,255,255,.45); 
    padding:14px 26px;
    border-radius:12px;
    text-decoration:none;
    font-weight:600;
    transition:.3s;
}

.btn-hero-outline:hover{
    background:rgba(255,255,255,.12);
    border-color:white;
}

/* =============================================
   =            PROFILE PAGE STYLES           =
   ============================================= */

/* Center the content max-width for better readability */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
}

/* --- Profile Header (Avatar area) --- */
.profile-header-card {
    text-align: center;
    background: linear-gradient(to bottom, #f0f8ff 50%, white 50%); /* Half-color background effect */
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background-color: #1e88e5;
    color: white;
    font-size: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px auto;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.profile-role {
    color: #1e88e5;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.profile-id {
    color: #999;
    font-size: 13px;
}

/* --- Info Grid Section --- */
.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.card-header-row h3 {
    color: #1565c0;
    margin: 0;
}

.btn-edit {
    background-color: white;
    border: 1px solid #1e88e5;
    color: #1e88e5;
    padding: 6px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.2s;
}

.btn-edit:hover {
    background-color: #1e88e5;
    color: white;
}

/* 2-Column Grid for Details */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 30px;
}

.info-item label {
    display: block;
    color: #999;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-item p {
    color: #333;
    font-size: 16px;
    font-weight: 500;
    background-color: #f9fbfd;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
}

/* Responsive: Stack columns on small screens */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== GENERIC MODAL SHELL =====
   Used by admin_dashboard.jsp (view report modal) and profile.jsp
   (edit profile modal). Page-specific inner content (e.g. admin's
   two-column image/details layout) lives in admin.css. */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    overflow-y: auto;
    padding: 30px 15px;
}

.modal-content {
    background: white;
    max-width: 700px;
    margin: 0 auto;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    animation: slideDown 0.3s ease;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: var(--blue-darkest);
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover { color: #000; }

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        margin: 10px;
    }
}

/* ===== NOTIFICATIONS ===== */
.notification-box {
    position: absolute;
    right: 0;
    top: 35px;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow:
    0 10px 25px rgba(0,0,0,.15);
    overflow: hidden;
    display: none;
}

.notification-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: .2s;
}

.notification-item:hover {
    background: #f8fbff;
}

/* ===== WELCOME BANNER ===== */

.welcome-banner {
    background:
        linear-gradient(
            135deg,
            #1e88e5,
            #64b5f6
        );
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow:
        0 10px 25px rgba(30,136,229,.2);
}

/* ===== QUICK ACTION CARDS ===== */

.quick-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    gap:20px;
}

.quick-card{
    background:white;
    border-radius:16px;
    padding:25px;
    text-decoration:none;
    color:#333;
    box-shadow:0 6px 20px rgba(0,0,0,.06);
    transition:.3s;
    border:1px solid #eef3f9;
    min-height:180px;
}

.quick-card:hover{
    transform:translateY(-6px);
    box-shadow:0 12px 30px rgba(21,101,192,.15);
}

.quick-card i{
    font-size:30px;
    color:#1565c0;
    margin-bottom:15px;
}

.quick-card h2{
    font-size:40px;
    color:#1565c0;
    font-weight:700;
    margin:10px 0 5px;
}

.quick-card h4{
    margin-bottom:8px;
}

.quick-card p{
    color:#777;
    font-size:15px;
}

.card-link{
    text-decoration:none;
    color:inherit;
}

/* ===== NOTIFICATION COUNT BUBBLE ===== */
/* Used to live as an inline style="" block in header.jsp */
.notification-wrapper{
    position:relative;
}

.notif-count{
    position:absolute;
    top:-5px;
    right:-10px;
    background:var(--danger);
    color:white;
    font-size:10px;
    padding:3px 6px;
    border-radius:50%;
}

#notifBell{
    cursor:pointer;
    font-size:18px;
    color:var(--blue-dark);
    margin-right:25px;
}

/* ===== EMPTY STATE (no reports / no data) ===== */
.empty-state{
    text-align:center;
    padding:50px 20px;
    color:var(--text-muted);
}

.empty-state i{
    font-size:48px;
    color:#cfd8dc;
    margin-bottom:15px;
}

.empty-state h3{
    color:var(--text-main);
    margin-bottom:8px;
}

/* ===== LIST ROW (used on My Chats page) ===== */
.chat-list-item{
    background:white;
    border-radius:12px;
    padding:20px;
    margin-bottom:15px;
    box-shadow:0 4px 15px rgba(30,136,229,.1);
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:15px;
}

/* ===========================================================
   MOBILE / RESPONSIVE
   =========================================================== */

/* --- Hamburger toggle (hidden on desktop) --- */
.sidebar-toggle{
    display:none;
    background:none;
    border:none;
    font-size:22px;
    color:var(--blue-darkest);
    cursor:pointer;
    margin-right:15px;
}

.sidebar-overlay{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.4);
    z-index:150;
}

@media (max-width: 992px){
    .sidebar-toggle{
        display:inline-block;
    }

    /* Sidebar becomes an off-canvas drawer */
    .sidebar{
        position:fixed;
        top:var(--header-height);
        left:0;
        bottom:0;
        width:240px;
        transform:translateX(-100%);
        transition:transform .3s ease;
        z-index:200;
        overflow-y:auto;
    }

    body.sidebar-open .sidebar{
        transform:translateX(0);
    }

    body.sidebar-open .sidebar-overlay{
        display:block;
    }

    .dashboard-container{
        min-height:calc(100vh - var(--header-height));
    }
}

@media (max-width: 768px){
    /* Header */
    .dashboard-header{
        padding:0 15px;
    }

    .logo-text{
        font-size:19px;
    }

    .profile-link span,
    .profile-link{
        font-size:14px;
    }

    .header-right{
        gap:0;
    }

    .btn-logout{
        padding:7px 12px;
        font-size:13px;
    }

    .notification-box{
        width:260px;
        right:-60px;
    }

    /* Main content */
    .main-content{
        padding:16px;
    }

    .content-card{
        padding:18px;
        border-radius:14px;
    }

    /* Hero card stacks vertically */
    .hero-card{
        padding:28px 22px;
    }

    .hero-top{
        flex-direction:column;
        align-items:flex-start;
        gap:20px;
    }

    .hero-card h2{
        font-size:24px;
    }

    .hero-intro{
        font-size:15px;
    }

    .hero-image{
        display:none; /* decorative icon, just adds clutter on small screens */
    }

    .hero-actions{
        width:100%;
    }

    .hero-actions a{
        flex:1;
        text-align:center;
    }

    /* Quick action grid */
    .quick-grid{
        grid-template-columns:1fr 1fr;
        gap:12px;
    }

    .quick-card{
        padding:18px;
        min-height:140px;
    }

    .quick-card h2{
        font-size:30px;
    }

    /* Auth card (login/signup/landing) */
    .auth-card{
        padding:30px 22px;
        margin:16px;
    }

    /* Profile info grid already handled at 768px above */
}

@media (max-width: 480px){
    .quick-grid{
        grid-template-columns:1fr;
    }

    .hero-actions{
        flex-direction:column;
    }

    .profile-link span{
        display:none; /* keep just the icon to save space */
    }

    .chat-list-item{
        flex-direction:column;
        align-items:flex-start;
    }

    .chat-list-item .btn{
        width:100%;
        justify-content:center;
    }
}