/* ========================= */
/* GLOBAL STYLES             */
/* ========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background-color: #f5f7fb;
    color: #333;
}

/* ========================= */
/* LAYOUT STRUCTURE          */
/* ========================= */

.container {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
}

/* PAGE CONTENT */

.content {
    padding: 30px;
}

/* ========================= */
/* SIDEBAR                   */
/* ========================= */

.sidebar {
    width: 250px;
    background: #002e5b;
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    padding-top: 20px;
}

.sidebar h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 20px;
}

.sidebar a {
    padding: 15px 25px;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
}

.sidebar a i {
    width: 18px;
    text-align: center;
}

.sidebar a:hover {
    background: #014a8c;
}

.sidebar a.active {
    background: #014a8c;
    font-weight: bold;
}

.nav-links {
    flex: 1;
}

.logout {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.2);
}

.notification-link {
    position: relative;
}

.notification-badge {
    position: absolute;
    right: 20px;
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    display: none;
}

.notification-badge.show {
    display: block;
}

/* THEME TOGGLE */

.theme-toggle {
    margin-top: 20px;
    padding: 0 15px;
}

#themeToggleBtn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #002e5b;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s ease;
}

#themeToggleBtn:hover {
    background: #004080;
    transform: translateY(-2px);
}

#themeToggleBtn:active {
    transform: translateY(0);
}

/* ========================= */
/* HEADER                    */
/* ========================= */

.header {
    height: 70px;
    background: white;
    display: flex;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid #e0e0e0;
}

.header img {
    height: 40px;
}

/* ========================= */
/* LOGIN                     */
/* ========================= */

.login-page {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #002e5b, #014a8c);
}

.login-box {
    width: 380px;
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0px 8px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.login-box img {
    width: 120px;
    margin-bottom: 15px;
}

.login-box h2 {
    margin-bottom: 25px;
    color: #002e5b;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #002e5b;
    border: none;
    color: white;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #014a8c;
}

.login-note {
    margin-top: 15px;
    font-size: 12px;
    color: #777;
}

/* ========================= */
/* CAROUSEL                  */
/* ========================= */

.carousel {
    width: 100%;
    max-width: 550px;
    height: 350px;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
    margin: 0 auto 40px auto;
}

.carousel img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    height: 100%;
}

/* ========================= */
/* FILTER SECTION            */
/* ========================= */

.filters {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.filter-group select {
    width: 200px;
    padding: 6px;
}

/* ========================= */
/* EVENT GRID & CARDS        */
/* ========================= */

.events-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 350px));
    gap: 20px;
}

.event-card {
    width: 300px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0px 4px 10px rgba(0,0,0,0.05);
    transition: 0.2s;
}

.event-card:hover {
    transform: translateY(-4px);
}

.event-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.event-info {
    padding: 15px;
    flex: 1;
}

.event-info a {
    text-decoration: none;
    color: #002e5b;
    font-weight: bold;
}

.event-info p {
    font-size: 13px;
    color: #777;
}

.event-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
}

.event-date {
    font-size: 14px;
    color: #777;
}

.event-location {
    font-size: 13px;
    margin-top: 5px;
}

/* ========================= */
/* EVENT DETAILS PAGE        */
/* ========================= */

.event-container {
    max-width: 900px;
    margin: auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.event-poster {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    margin: 0 auto 15px auto;
}

.event-meta {
    margin: 15px 0;
    line-height: 1.8;
}

.event-meta i {
    width: 20px;
    color: #002e5b;
}

.event-description {
    margin-top: 20px;
    line-height: 1.6;
}

.event-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.event-row img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

/* ========================= */
/* CALENDAR                  */
/* ========================= */

.calendar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 22px;
}

.calendar-nav button {
    padding: 6px 12px;
    margin: 0 3px;
    border: none;
    background: #002e5b;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.calendar-nav button:hover {
    background: #014a8c;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day-name {
    font-weight: bold;
    text-align: center;
    padding: 8px;
}

.calendar-day {
    border: 1px solid #eee;
    min-height: 90px;
    padding: 6px;
    position: relative;
    cursor: pointer;
    font-size: 14px;
    overflow: hidden;
}

.calendar-day:hover {
    background: #f3f6ff;
}

.calendar-event-preview {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 10px;
    width: 100%;
    overflow: hidden;
}

.calendar-event-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-size: 10px;
    font-weight: 500;
}

.event-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #002e5b;
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

.calendar-day:hover .event-tooltip {
    display: block;
}

/* EVENT DOTS */

.event-dot {
    width: 6px;
    height: 6px;
    background: #007bff;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
    position: relative;
    top: -2px;
}

.event-dot.past {
    background: #999;
    opacity: 0.6;
}

.event-dot.academic {
    background: #007bff;
}

.event-dot.sports {
    background: #e6b400;
}

.event-dot.cultural {
    background: #e83e8c;
}

.event-stack {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* TODAY HIGHLIGHT */

.today {
    border: 2px solid #002e5b;
    background: #eef3ff;
    font-weight: bold;
}

/* EVENT LIST BELOW CALENDAR */

.event-list {
    margin-top: 20px;
    background: white;
    padding: 20px;
    border-radius: 10px;
}

.saved-event {
    background: #fff8dc;
    border: 2px solid #f0b400;
}

/* ========================= */
/* NOTIFICATIONS             */
/* ========================= */

.notifications-container {
    max-width: 900px;
    margin: auto;
}

.notification-card {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: white;
    padding: 18px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 15px;
    cursor: pointer;
    transition: 0.2s;
}

.notification-card:hover {
    background: #f5f7ff;
}

.notification-icon {
    font-size: 20px;
    color: #002e5b;
    margin-top: 3px;
}

.notification-content {
    flex: 1;
}

.notification-content a {
    text-decoration: none;
    color: #002e5b;
    font-weight: bold;
}

.notification-time {
    font-size: 12px;
    color: #777;
    margin-top: 5px;
}

.unread {
    border-left: 4px solid #002e5b;
    background: #eef3ff;
}

/* ========================= */
/* PROFILE                   */
/* ========================= */

.profile-container {
    max-width: 1000px;
    margin: auto;
}

.profile-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #555;
}

.profile-info h3 {
    margin-bottom: 5px;
}

.profile-info p {
    color: #666;
    margin: 2px 0;
}

.saved-events {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.saved-events h3 {
    margin-bottom: 20px;
}

.saved-event-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.saved-event-card img {
    width: 70px;
    height: 50px;
    object-fit: cover;
    border-radius: 5px;
}

.saved-event-info {
    flex: 1;
}

.saved-event-info a {
    text-decoration: none;
    color: #002e5b;
    font-weight: bold;
}

.saved-event-info p {
    font-size: 13px;
    color: #777;
}

.saved-event-badges {
    margin-left: 20px;
    flex-shrink: 0;
}

.saved-event-badges .badge,
.saved-event-badges .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    min-width: 80px;
    padding: 0 12px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    color: white;
}

/* ========================= */
/* ORGANISER                 */
/* ========================= */

.organiser-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.organiser-events {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.organiser-events h3 {
    margin-bottom: 20px;
}

/* ========================= */
/* FORMS                     */
/* ========================= */

.form-container {
    max-width: 800px;
    margin: auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* ========================= */
/* BUTTONS                   */
/* ========================= */

.btn {
    padding: 8px 14px;
    background: #002e5b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn:hover {
    background: #014a8c;
}

.add-event-btn {
    background: #002e5b;
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-event-btn:hover {
    background: #014a8c;
}

.save-button {
    margin-top: 20px;
    padding: 10px 16px;
    background: #002e5b;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.save-button:hover {
    background: #014a8c;
}

.save-button.saved i {
    color: gold;
}

.submit-btn {
    margin-top: 10px;
    background: #002e5b;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.submit-btn:hover {
    background: #014a8c;
}

.update-btn {
    background: #002e5b;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.update-btn:hover {
    background: #014a8c;
}

.edit-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
}

.edit-btn:hover {
    background: #0056b3;
}

.cancel-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
}

.cancel-btn:hover {
    background: #a71d2a;
}

.delete-btn {
    background: #c0392b;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    margin-left: 8px;
}

.delete-btn:hover {
    background: #a93226;
    transform: translateY(-1px);
}

.delete-btn i {
    margin-right: 6px;
}


/* ========================= */
/* BADGES & STATUS           */
/* ========================= */

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    color: white;
    margin-top: 8px;
}

.badge.academic {
    background: #007bff;
}

.badge.sports {
    background: #e6b400;
}

.badge.cultural {
    background: #e83e8c;
}

.badge.cancelled {
    background: #e74c3c;
    color: white;
}

.cancelled-title {
    color: #e74c3c;
}

.status {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    color: white;
}

.status-badge {
    padding: 4px 8px;
    font-size: 12px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
}

.status-active {
    background: #27ae60;
}

.status-completed {
    background: #7f8c8d;
}

.status-cancelled {
    background: #e74c3c;
}

.status-past {
    background: #555;
}

/* ========================= */
/* ADMIN DASHBOARD           */
/* ========================= */

.admin-filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    flex-wrap: wrap;
}

.admin-filters select {
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    font-size: 14px;
}

.admin-table-wrapper {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.admin-table small {
    color: #666;
    font-size: 12px;
    word-break: break-word;
}

.admin-table thead {
    background: #002e5b;
    color: white;
}

.admin-table th {
    padding: 12px;
    text-align: left;
    font-size: 14px;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: #f5f7ff;
}

.admin-table a {
    text-decoration: none;
    color: #002e5b;
    font-weight: bold;
}

.admin-actions {
    display: flex;
    gap: 8px;
}

.admin-cancel-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
}

.admin-cancel-btn:hover {
    background: #a71d2a;
}

.admin-delete-btn{
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s ease;
}
    
.admin-delete-btn:hover{
    background: #a71d2a;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
}

.pagination-controls button {
    padding: 6px 12px;
    border: none;
    background: #002e5b;
    color: white;
    border-radius: 5px;
    cursor: pointer;
}

.pagination-controls button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ========================= */
/* DASHBOARD CARDS & CHARTS  */
/* ========================= */

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.dashboard-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.dashboard-card p {
    font-size: 28px;
    font-weight: bold;
    margin-top: 10px;
}

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ========================= */
/* DARK MODE                 */
/* ========================= */

body.dark-mode {
    background: #121212;
    color: white;
}

body.dark-mode .sidebar {
    background: #1e1e1e;
}

body.dark-mode .main-content {
    background: #181818;
}

body.dark-mode .content {
    background: #181818;
}

body.dark-mode .header {
    background: #1e1e1e;
    border-bottom: 1px solid #444;
}

/* Cards */

body.dark-mode .event-card,
body.dark-mode .form-container,
body.dark-mode .dashboard-card,
body.dark-mode .chart-card,
body.dark-mode .admin-table {
    background: #242424;
    color: white;
}

body.dark-mode .profile-card,
body.dark-mode .saved-events,
body.dark-mode .organiser-events,
body.dark-mode .calendar,
body.dark-mode .event-list,
body.dark-mode .filters,
body.dark-mode .notification-card,
body.dark-mode .event-container {
    background: #242424;
    color: #ffffff;
}

body.dark-mode .dashboard-card,
body.dark-mode .chart-card {
    background: #242424;
}

/* Hover States */

body.dark-mode .notification-card:hover {
    background: #2f2f2f;
}

body.dark-mode .calendar-day:hover {
    background: #2f2f2f;
}

body.dark-mode .admin-table tbody tr:hover {
    background: #2f2f2f;
}

/* Calendar */

body.dark-mode .calendar-day {
    border: 1px solid #444;
    background: #242424;
}

body.dark-mode .calendar-day-name {
    color: white;
}

body.dark-mode .today {
    background: #2f2f2f;
    border: 2px solid #7db7ff;
}

body.dark-mode .saved-event {
    background: #3a3215;
    border: 2px solid #d4a017;
}

/* Event Information */

body.dark-mode .event-date,
body.dark-mode .event-location,
body.dark-mode .saved-event-info p,
body.dark-mode .profile-info p,
body.dark-mode .notification-time,
body.dark-mode .event-info p {
    color: #bdbdbd;
}

body.dark-mode .event-meta i {
    color: #7db7ff;
}

/* Links */

body.dark-mode a,
body.dark-mode .saved-event-info a,
body.dark-mode .event-info a,
body.dark-mode .notification-content a,
body.dark-mode .admin-table a {
    color: #7db7ff;
}

/* Form Elements */

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea,
body.dark-mode .form-group input,
body.dark-mode .form-group select,
body.dark-mode .form-group textarea,
body.dark-mode .admin-filters select {
    background: #2f2f2f;
    color: white;
    border: 1px solid #555;
}

/* Tables */

body.dark-mode table {
    color: white;
}

body.dark-mode th {
    background: #2f2f2f;
}

body.dark-mode td {
    background: #242424;
}

body.dark-mode .admin-table {
    background: #242424;
}

body.dark-mode .admin-table td {
    border-bottom: 1px solid #444;
}

body.dark-mode .admin-table small {
    color: #bdbdbd;
}

/* Profile */

body.dark-mode .profile-avatar {
    background: #333;
    color: white;
}

/* Notifications */

body.dark-mode .unread {
    background: #1f2a3a;
    border-left: 4px solid #7db7ff;
}

/* Borders */

body.dark-mode .logout {
    border-top: 1px solid #444;
}

body.dark-mode .saved-event-card,
body.dark-mode .event-row {
    border-bottom: 1px solid #444;
}

/* Pagination */

body.dark-mode .pagination-controls button:disabled {
    background: #555;
}

/* Theme Toggle */

body.dark-mode #themeToggleBtn {
    background: #444;
    color: white;
}

body.dark-mode #themeToggleBtn:hover {
    background: #555;
}

/* Scrollbars */

body.dark-mode ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

body.dark-mode ::-webkit-scrollbar-track {
    background: #1e1e1e;
}

body.dark-mode ::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 5px;
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* ========================= */
/* RESPONSIVE DESIGN         */
/* ========================= */

@media (max-width: 900px) {

    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }

    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

}

@media (max-width: 600px) {

    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .content {
        padding: 20px;
    }

    .dashboard-cards {
        grid-template-columns: 1fr;
    }

    .chart-grid {
        grid-template-columns: 1fr;
    }

}