/* === Global Styles === */
/* These apply to ALL pages */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f4f7f6; /* Default background */
}

* {
    box-sizing: border-box;
}

/* === Login Page Styles === */
/* Add class="login-body" to your login page's <body> tag */
.login-body {
    background-color: #34495e;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    max-width: 400px;
    width: 90%;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-top: 0;
}
.login-container p {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
}

.input-group input[type="text"],
.input-group input[type="email"],
.input-group input[type="password"],
.input-group input[type="tel"],
.input-group input[type="date"],
.input-group input[type="number"],
.input-group input[type="datetime-local"],
.input-group select,
.input-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}
.input-group small {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
    display: block;
}

.btn {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    border: none;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn:hover {
    background-color: #2980b9;
}

.error-msg {
    color: #c0392b;
    background-color: #fbeae9;
    border: 1px solid #c0392b;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 15px;
}

.success-msg {
    color: #27ae60;
    background-color: #eafaf1;
    border: 1px solid #27ae60;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin-bottom: 15px;
}


/* === Admin Panel Layout === */
.sidebar {
    width: 250px; /* Full width */
    background-color: #2c3e50;
    color: white;
    height: 100vh; /* Full height */
    position: fixed; /* Sticky sidebar */
    top: 0;
    left: 0;
    flex-shrink: 0;
    transition: width 0.3s ease, left 0.3s ease; /* Added left transition */
    overflow-x: hidden; /* Collapsing ke time content hide karega */
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    background-color: #34495e;
    border-bottom: 1px solid #4a627a;
    white-space: nowrap; /* Header text ko wrap hone se rokega */
}
.sidebar-header h3 {
    margin: 0;
    color: #ecf0f1;
    transition: display 0.3s;
}

.sidebar-nav {
    /* Container for links */
}

.sidebar-nav .nav-link {
    display: flex; /* Flex ka istemal icon aur text ko align karne ke liye */
    align-items: center;
    padding: 15px 20px;
    color: #bdc3c7;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s;
    border-bottom: 1px solid #34495e;
    white-space: nowrap; /* Text ko wrap hone se rokega */
}
.sidebar-nav .nav-link i {
    margin-right: 15px; /* Icon aur text ke beech space */
    width: 20px;
    text-align: center;
    transition: margin 0.3s ease;
}
.sidebar-nav .nav-link:hover {
    background-color: #34495e;
    color: #ffffff;
}
.sidebar-nav .nav-link.active {
    background-color: #3498db;
    color: #ffffff;
}
.sidebar-nav .logout-link {
    border-top: 1px solid #4a627a;
    margin-top: 10px;
}

.main-content {
    margin-left: 250px; /* Default sidebar width */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky; /* Make header sticky */
    top: 0;
    z-index: 10;
}

.menu-toggle {
    display: block; /* Hamburger icon hamesha dikhega */
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #2c3e50;
}

.user-info {
    font-weight: bold;
    color: #2c3e50;
}

.content-body {
    padding: 20px;
    flex-grow: 1;
    background-color: #ecf0f1;
}

.content-box {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

/* === COLLAPSED STATE STYLES (Desktop) === */
.sidebar.collapsed {
    width: 70px; /* Collapsed width */
}
.sidebar.collapsed .sidebar-header h3 {
    display: none; /* "YUVA SENA Admin" text hide karega */
}
.sidebar.collapsed .nav-link-text {
    display: none; /* Link text (Dashboard, Members, etc.) hide karega */
}
.sidebar.collapsed .nav-link i {
    margin-right: 0; /* Icon ko center karega jab text hide ho */
    width: 100%;
}
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 15px 10px;
}
.main-content.collapsed {
    margin-left: 70px; /* Collapsed sidebar width */
}


/* === Dashboard Stat Cards === */
.stat-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.stat-icon {
    font-size: 30px;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
}

.stat-label {
    font-size: 14px;
    color: #7f8c8d;
}

/* === Table Styles === */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
}
.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.content-table thead { background-color: #34495e; color: #ffffff; }
.content-table th,
.content-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
    vertical-align: middle;
}
.content-table tbody tr { background-color: #ffffff; border-bottom: 1px solid #f0f0f0; }
.content-table tbody tr:nth-of-type(even) { background-color: #f9f9f9; }
.content-table tbody tr:hover { background-color: #f1f1f1; }
.content-table .actions { display: flex; gap: 5px; flex-wrap: wrap; }

.btn-small {
    padding: 5px 8px;
    font-size: 12px;
    text-decoration: none;
    border-radius: 4px;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: auto; /* Override full width btn */
    font-weight: normal;
}
.btn-primary { background-color: #3498db; }
.btn-primary:hover { background-color: #2980b9; }
.btn-danger { background-color: #e74c3c; }
.btn-danger:hover { background-color: #c0392b; }
.btn-success { background-color: #2ecc71; }
.btn-success:hover { background-color: #27ae60; }
.btn-secondary { background-color: #95a5a6; }
.btn-secondary:hover { background-color: #7f8c8d; }
.btn-warning { background-color: #f39c12; }
.btn-warning:hover { background-color: #e67e22; }


/* === Status Badge Styles === */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-transform: capitalize;
}
.status-pending, .status-on-hold, .status-ongoing { background-color: #f39c12; }
.status-approved, .status-pass, .status-completed { background-color: #2ecc71; }
.status-rejected, .status-fail { background-color: #e74c3c; }
.status-admin { background-color: #9b59b6; }
.status-member { background-color: #3498db; }
.status-inactive { background-color: #95a5a6; }


/* === Filter Bar Styles === */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    gap: 10px;
}
.filter-bar h1 { margin: 0; }
.filter-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    background-color: #fdfdfd;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}
.filter-form input[type="text"],
.filter-form select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    flex-grow: 1;
    width: auto;
}
.filter-form .btn {
    width: auto;
    font-size: 14px;
    padding: 10px 15px;
}

/* === Pagination Styles === */
.pagination { margin-top: 20px; text-align: center; }
.pagination a {
    color: #3498db;
    padding: 8px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0 2px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.pagination a:hover { background-color: #f1f1f1; }
.pagination a.active { background-color: #3498db; color: white; border-color: #3498db; }

/* === Form Styles === */
.form-container {
    /* .content-box already provides this */
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.form-container .input-group { margin-bottom: 0; }

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}
.form-actions .btn {
    width: auto;
}

/* Question management specific */
.question-card {
    border: 1px solid #eee;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.03);
}
.question-header {
    padding: 15px;
    background-color: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.question-header h4 {
    margin: 0;
}
.question-body {
    padding: 15px;
}
.question-options {
    list-style-type: none;
    padding-left: 0;
}
.question-options li {
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 5px;
}
.question-options li.correct {
    background-color: #eafaf1;
    border: 1px solid #27ae60;
    color: #27ae60;
    font-weight: bold;
}
.question-options li.incorrect {
    background-color: #fbeae9;
    border: 1px solid #c0392b;
    color: #c0392b;
    font-weight: bold;
}
.question-options li i {
    margin-right: 10px;
}
.option-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.option-input-group input[type="radio"] {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}
.option-input-group input[type="text"] {
    flex-grow: 1;
}

/* === RESPONSIVE STYLES === */
/* Target tablets */
@media (max-width: 992px) {
    /* On tablets, use the collapsed 'icon-only' sidebar */
    .sidebar {
        width: 70px;
    }
    .sidebar.collapsed {
        width: 70px;
    }
    .main-content {
        margin-left: 70px;
    }
    .main-content.collapsed {
        margin-left: 70px;
    }
    
    .sidebar .nav-link-text { display: none; }
    .sidebar .sidebar-header h3 { display: none; }
    .sidebar .nav-link i { margin-right: 0; width: 100%; }
    .sidebar .nav-link { justify-content: center; padding: 15px 10px; }

    /* Hide the desktop toggle button, it's not needed */
    .menu-toggle {
        display: none;
    }
    
    .form-grid {
        grid-template-columns: 1fr; /* Stack form fields */
    }
}

/* Target mobile phones */
@media (max-width: 768px) {
    .sidebar {
        width: 250px;
        position: fixed;
        left: -250px; /* Start off-screen */
        top: 0;
        height: 100vh;
        z-index: 999;
        transition: left 0.3s ease;
    }
    /* This overrides the desktop .collapsed style */
    .sidebar.collapsed {
        left: -250px; /* Off-screen */
        width: 250px; /* Full width when it slides out */
    }
    /* This new class controls visibility on mobile */
    .sidebar.mobile-visible {
        left: 0; /* On-screen */
    }
    
    .main-content {
        margin-left: 0;
    }
    .main-content.collapsed {
        margin-left: 0;
    }

    /* Show the toggle button again for mobile */
    .menu-toggle {
        display: block; 
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-bar .btn {
        width: 100%;
    }
    
    .filter-form {
        flex-direction: column;
    }
    .filter-form input[type="text"],
    .filter-form select,
    .filter-form .btn {
        width: 100%;
    }

    .stat-card-container {
        grid-template-columns: 1fr; /* Stack stat cards */
    }
    
    .top-header {
        flex-wrap: wrap;
        padding: 10px 15px;
    }
    .user-info {
        font-size: 14px;
    }
    
    .login-container {
        width: 95%;
        padding: 20px;
    }
    
    /* Dark overlay for when menu is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0,0,0,0.5);
        z-index: 998;
    }
    .sidebar-overlay.visible {
        display: block;
    }
}