/* ========== Reset & variables ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0077be;
    --secondary: #003d5c;
    --accent: #00a8e8;
    --light: #e8f4f8;
    --dark: #1a1a1a;
    --danger: #e74c3c;
    --success: #27ae60;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* ========== Header & navigation ========== */
header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
    color: white;
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
}

.page-index .logo {
    color: inherit;
}

.logo img {
    height: 80px;
    width: 80px;
    background: white;
    border-radius: 50%;
    padding: 5px;
    object-fit: contain;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    transition: color 0.3s, background 0.3s;
    font-weight: 500;
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
}

nav a:hover,
.nav-button:hover {
    color: var(--accent);
    background: rgba(255, 255, 255, 0.2);
}

.nav-link-current {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.nav-button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid white;
    color: white;
    padding: 0.45rem 0.9rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    font-weight: 500;
    font-family: inherit;
    font-size: inherit;
}

.nav-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ========== Account dropdown menu ========== */
.nav-account-menu {
    position: relative;
}

.nav-account-menu.logged-out .account-dropdown {
    display: none;
}

.account-dropdown {
    list-style: none;
    position: absolute;
    top: 100%;
    left: 50%;
    right: auto;
    background: var(--secondary);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -10px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    z-index: 999;
    margin-top: 0.5rem;
}

.account-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.account-dropdown li {
    padding: 0;
    width: 100%;
}

.account-dropdown a,
.account-dropdown button {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.3s;
    font-family: inherit;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
}

/* ========== Footer ========== */
footer {
    background: var(--secondary);
    color: white;
    text-align: center;
    padding: 2rem;
}

/* ========== Auth pages (login, reset-password) ========== */
body.page-auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--light);
}

.page-auth main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8rem 1rem 3rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 2rem;
    position: relative;
}

.auth-card h1 {
    color: var(--secondary);
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
    text-align: center;
}

.auth-card > p {
    color: #555;
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-card .form-group {
    margin-bottom: 1rem;
}

.auth-card label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--secondary);
    font-weight: 600;
}

.auth-card input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

.auth-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 119, 190, 0.18);
}

/*
.auth-card .btn-primary {
    width: 100%;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.85rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.auth-card .btn-primary:hover {
    background: var(--secondary);
}

.auth-card .btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
*/

.btn-primary {
    width: 100%;
    border: none;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.85rem;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--secondary);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-link:hover {
    color: var(--secondary);
}

#form-message {
    margin-bottom: 1rem;
    font-size: 0.95rem;
    text-align: center;
    min-height: 1.2rem;
}

#form-message.error {
    color: #c62828;
}

#form-message.success {
    color: #1b5e20;
}

.helper-link {
    margin-top: 1rem;
    text-align: center;
}

.helper-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.helper-link a:hover {
    text-decoration: underline;
}

.forgot-section {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.forgot-section[hidden],
#forgot-form[hidden] {
    display: none;
}

#forgot-form {
    margin-top: 1rem;
}

.auth-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 2;
}

.auth-loader span {
    width: 28px;
    height: 28px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== Index (home) ========== */
.page-index .hero {
    background: linear-gradient(rgba(0, 61, 92, 0.7), rgba(0, 119, 190, 0.7)),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23003d5c" width="1200" height="600"/><path fill="%230077be" opacity="0.3" d="M0 300 Q300 200 600 300 T1200 300 V600 H0 Z"/></svg>');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 150px 2rem 100px;
    text-align: center;
    margin-top: 70px;
}

.page-index .hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-index .hero p {
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.page-index .btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.page-index .btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.page-index .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.page-index section {
    margin-bottom: 4rem;
}

.page-index .container > section > h2 {
    color: var(--secondary);
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.page-index .container > section > h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent);
}

.page-index .courses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.page-index .course-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.page-index .course-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.page-index .course-card h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.page-index .diamond-section {
    background: var(--light);
    padding: 3rem;
    border-radius: 10px;
    margin-top: 2rem;
}

.page-index .events-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.page-index .event-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: center;
}

.page-index .event-info h3 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.page-index .event-detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    color: #666;
}

.page-index .loading {
    text-align: center;
    padding: 2rem;
    color: var(--dark);
}

/* Index login dialog */
dialog {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    padding: 0;
    max-width: 400px;
    width: 90%;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

#login-modal .modal-content {
    padding: 2rem;
    position: relative;
}

#login-modal .modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

#login-modal .modal-header h2 {
    color: var(--secondary);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    text-align: center;
}

#login-modal .modal-header h2::after {
    display: none;
}

#login-modal .form-group {
    margin-bottom: 1rem;
}

#login-modal .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary);
}

#login-modal .form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#login-modal .form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 119, 190, 0.2);
}

#login-modal .modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

#login-modal .modal-actions button {
    flex: 1;
    padding: 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

/*
#login-modal .btn-primary {
    background: var(--primary);
    color: white;
}

#login-modal .btn-primary:hover {
    background: var(--secondary);
}

#login-modal .btn-primary:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}
*/

#login-modal .btn-secondary {
    background: #f5f5f5;
    color: #333;
}

#login-modal .btn-secondary:hover {
    background: #e0e0e0;
}

#login-modal .login-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    z-index: 2;
}

#login-modal .login-loader span {
    width: 28px;
    height: 28px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== Dashboard ========== */
body.page-dashboard {
    background: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-dashboard .dashboard-main {
    flex: 1;
    padding-top: 6rem;
    padding-bottom: 2rem;
}

.page-dashboard .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.page-dashboard .tabs {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #ddd;
}

.page-dashboard .tab-btn {
    padding: 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: #333;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.page-dashboard .tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.page-dashboard .tab-content {
    display: none;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.page-dashboard .tab-content.active {
    display: block;
}

/* Manager-only UI: hidden by default and revealed by JS for managers */
.page-dashboard .manager-only {
    display: none !important;
}

.page-dashboard .section {
    margin-bottom: 1rem;
}

.page-dashboard .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-dashboard .section-header h2 {
    margin: 0;
    color: var(--secondary);
    font-size: 1.5rem;
}

.page-dashboard .search-panel {
    padding: 1rem;
    background: #fcfcfc;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.page-dashboard .section-note {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 1rem;
}

.page-dashboard .events-table-wrapper {
    overflow-x: auto;
}

.page-dashboard .dashboard-modal .modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-dashboard .section h2 {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light);
    font-size: 1.5rem;
    text-align: left;
}

.page-dashboard .section h2::after {
    display: none;
}

.page-dashboard .form-group {
    margin-bottom: 1rem;
}

.page-dashboard .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.page-dashboard .form-group input,
.page-dashboard .form-group textarea,
.page-dashboard .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

.page-dashboard .form-group input:focus,
.page-dashboard .form-group textarea:focus,
.page-dashboard .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 119, 190, 0.2);
}

.page-dashboard .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.page-dashboard .btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.page-dashboard .btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.page-dashboard .btn-danger {
    background: var(--danger);
}

.page-dashboard .btn-danger:hover {
    background: #c0392b;
}

.page-dashboard .btn-approved-private {
    background: var(--success);
    color: white;
}

.page-dashboard .btn-approved-private:hover {
    background: var(--success);
    color: white;
    cursor: default;
}

.page-dashboard .btn-approved {
    background: var(--success); /* #27ae60 */
    color: white;
}

.page-dashboard .btn-approved:hover {
    background: #c0392b;
}

.page-dashboard .btn-waiting {
    background: #f1c40f;
}

.page-dashboard .btn-waiting:hover {
    background: #c0392b;
}

.page-dashboard .btn-capacity-waiting {
    background: #e67e22;
}

.page-dashboard .btn-capacity-waiting:hover {
    background: #c0392b;
}

.page-dashboard table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.page-dashboard table thead {
    background: var(--light);
    border-bottom: 2px solid var(--primary);
}

.page-dashboard table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--secondary);
}

.page-dashboard table td {
    padding: 1rem;
    border-bottom: 1px solid #ddd;
}

.page-dashboard table tr:hover {
    background: #f9f9f9;
}

.page-dashboard .action-btn {
    padding: 0.5rem 1rem;
    margin-right: 0.5rem;
    font-size: 0.875rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

#events-table .action-btn {
    width: 180px;
}

.page-dashboard .action-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

.page-dashboard .action-btn-edit {
    background: var(--accent);
    color: white;
}

.page-dashboard .action-btn-edit:hover {
    background: var(--primary);
}

.page-dashboard .action-btn-delete {
    background: var(--danger);
    color: white;
}

.page-dashboard .alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    border-left: 4px solid;
}

.page-dashboard .alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.page-dashboard .alert-error {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 2200;
    max-width: 320px;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 1rem 1.25rem;
    border-radius: 0.85rem;
    color: white;
    font-weight: 600;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transform: translateX(110%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.toast--visible {
    transform: translateX(0);
    opacity: 1;
}

.toast--success {
    background: #27ae60;
}

.toast--error {
    background: #e74c3c;
}

.toast--info {
    background: #0077be;
}

.page-dashboard .dashboard-modal {
    display: none;
    position: fixed;
    z-index: 2100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.page-dashboard .dashboard-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.page-dashboard .dashboard-modal .modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

#participants-modal .modal-content {
    max-width: min(98vw, 1360px);
    width: min(98vw, 1360px);
    padding: 1.25rem 1.5rem;
    box-sizing: border-box;
}

#participants-modal .events-table-wrapper {
    overflow-x: visible;
}

#participants-modal #participants-table {
    table-layout: fixed;
    width: 100%;
    min-width: 0;
    margin-top: 0.75rem;
}

#participants-modal #participants-table th,
#participants-modal #participants-table td {
    padding: 0.5rem 0.625rem;
    vertical-align: middle;
}

#participants-modal #participants-table th:nth-child(1),
#participants-modal #participants-table td:nth-child(1) {
    width: 14%;
}

#participants-modal #participants-table th:nth-child(2),
#participants-modal #participants-table td:nth-child(2) {
    width: 11%;
}

#participants-modal #participants-table th:nth-child(3),
#participants-modal #participants-table td:nth-child(3) {
    width: 11%;
}

#participants-modal #participants-table th:nth-child(4),
#participants-modal #participants-table td:nth-child(4) {
    width: 15%;
}

#participants-modal #participants-table th:nth-child(5),
#participants-modal #participants-table td:nth-child(5) {
    width: 15%;
}

#participants-modal #participants-table th:nth-child(6),
#participants-modal #participants-table td:nth-child(6) {
    width: 10%;
}

#participants-modal #participants-table th:nth-child(7),
#participants-modal #participants-table td:nth-child(7) {
    width: 24%;
}

#participants-modal #participants-table td:nth-child(1) {
    word-break: break-word;
    white-space: normal;
}

#participants-modal #participants-table td:last-child {
    white-space: normal;
}

#participants-modal #participants-table .action-btn {
    padding: 0.4rem 0.65rem;
    margin: 0 0.35rem 0.35rem 0;
    font-size: 0.8125rem;
}

#participants-modal input[type="text"] {
    width: 100%;
    min-width: 0;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0.5rem 0.625rem;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9375rem;
}

.page-dashboard .dashboard-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 1rem;
}

.page-dashboard .dashboard-modal .modal-header h2 {
    margin: 0;
    color: var(--secondary);
    font-size: 1.25rem;
}

.page-dashboard .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.page-dashboard .confirm-dialog-modal {
    z-index: 2200;
}

.page-dashboard .confirm-dialog-content {
    max-width: 420px;
    padding: 1.5rem;
}

.page-dashboard .confirm-dialog-title {
    margin: 0 0 0.75rem;
    color: var(--secondary);
    font-size: 1.25rem;
}

.page-dashboard .confirm-dialog-message {
    margin: 0 0 1.5rem;
    color: #555;
    line-height: 1.5;
}

.page-dashboard .confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ========== 404 page ========== */
body.page-404 {
    background: linear-gradient(135deg, #003d5c 0%, #0077be 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    overflow: hidden;
}

.page-404 .error-container {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    position: relative;
    z-index: 10;
}

.page-404 .error-logo {
    margin-bottom: 2rem;
    animation: float 3s ease-in-out infinite;
}

.page-404 .error-logo img {
    width: 120px;
    height: auto;
    background: white;
    border-radius: 50%;
    padding: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.page-404 h1 {
    font-size: 8rem;
    margin-bottom: 1rem;
    text-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: wave 2s ease-in-out infinite;
}

.page-404 h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.page-404 p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.6;
}

.page-404 .buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.page-404 .btn {
    display: inline-block;
    padding: 12px 30px;
    background: #00a8e8;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid transparent;
}

.page-404 .btn:hover {
    background: transparent;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.page-404 .fish {
    position: absolute;
    font-size: 2rem;
    opacity: 0.3;
    animation: swim 15s linear infinite;
}

.page-404 .fish:nth-child(1) { top: 20%; animation-duration: 20s; }
.page-404 .fish:nth-child(2) { top: 40%; animation-duration: 25s; animation-delay: 3s; }
.page-404 .fish:nth-child(3) { top: 60%; animation-duration: 18s; animation-delay: 6s; }
.page-404 .fish:nth-child(4) { top: 80%; animation-duration: 22s; animation-delay: 9s; }

.page-404 .bubble {
    position: absolute;
    bottom: -50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
    opacity: 0.5;
}

.page-404 .bubble:nth-child(1) { width: 40px; height: 40px; left: 10%; animation-duration: 8s; }
.page-404 .bubble:nth-child(2) { width: 20px; height: 20px; left: 30%; animation-duration: 10s; animation-delay: 2s; }
.page-404 .bubble:nth-child(3) { width: 30px; height: 30px; left: 50%; animation-duration: 7s; animation-delay: 4s; }
.page-404 .bubble:nth-child(4) { width: 25px; height: 25px; left: 70%; animation-duration: 9s; animation-delay: 1s; }
.page-404 .bubble:nth-child(5) { width: 35px; height: 35px; left: 90%; animation-duration: 11s; animation-delay: 3s; }

/* ========== Animations ========== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes wave {
    0%, 100% { transform: rotate(-3deg); }
    50% { transform: rotate(3deg); }
}

@keyframes swim {
    0% { left: -10%; transform: scaleX(1); }
    49% { transform: scaleX(1); }
    50% { left: 110%; transform: scaleX(-1); }
    100% { left: -10%; transform: scaleX(-1); }
}

@keyframes rise {
    0% { bottom: -50px; opacity: 0; }
    50% { opacity: 0.5; }
    100% { bottom: 110%; opacity: 0; }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    nav ul {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
        width: 100%;
        text-align: center;
        transition: left 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.3);
        gap: 0;
    }

    nav ul.active {
        left: 0;
    }

    nav ul li {
        padding: 1rem 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    /* reduce surrounding vertical space for account submenu */
    nav ul li.nav-account-menu {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .account-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: rgba(0, 0, 0, 0.2);
        box-shadow: none;
        max-width: 100%;
        padding-top: 0;
        padding-bottom: 0;
        border-radius: 0;
        margin-top: 0.5rem;
    }

    .account-dropdown li {
        padding: 0.7rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);        
    }

    .account-dropdown a,
    .account-dropdown button {
        padding: 0.25rem 0.5rem;
        text-align: center;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo img {
        height: 60px;
        width: 60px;
    }

    .page-index .hero {
        margin-top: 90px;
        padding: 100px 1rem 80px;
    }

    .page-index .hero h1 {
        font-size: 2rem;
    }

    .page-index .hero p {
        font-size: 1.1rem;
    }

    .page-index .event-card {
        grid-template-columns: 1fr;
    }

    .page-index .container {
        padding: 2rem 1rem;
    }

    .page-index .container > section > h2 {
        font-size: 2rem;
    }

    .page-index .diamond-section {
        padding: 2rem 1rem;
    }

    .page-dashboard .dashboard-main {
        padding-top: 5.5rem;
    }

    .page-dashboard .tabs {
        flex-wrap: wrap;
    }

    .page-dashboard .tab-btn {
        flex: 1;
        min-width: 150px;
    }

    .page-dashboard table {
        font-size: 0.875rem;
    }

    .page-dashboard table th,
    .page-dashboard table td {
        padding: 0.75rem 0.5rem;
    }

    .page-404 h1 {
        font-size: 5rem;
    }

    .page-404 h2 {
        font-size: 1.5rem;
    }

    .page-404 .error-logo img {
        width: 80px;
    }

    .page-404 .buttons {
        flex-direction: column;
    }

    .page-404 .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .logo span {
        font-size: 1rem;
    }

    .logo img {
        height: 50px;
        width: 50px;
    }

    nav {
        padding: 0 1rem;
    }
}

.page-dashboard .equipment-row {
    align-items: stretch;
}

.page-dashboard .equipment-row > fieldset,
.page-dashboard .equipment-row > .form-group {
    padding: 0.5rem;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.page-dashboard .checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-dashboard .checkbox-item label {
    margin-bottom: 0;
    font-weight: 500;
}

.page-dashboard .checkbox-item input[type="checkbox"] {
    width: auto;
}