/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body and base text */
body {
    font-family: 'Segoe UI', sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
    padding-top: 60px; /* for fixed header */
}

/* Form styling */
form {
    max-width: 400px;
    margin: 20px auto;
    background: white;
    padding: 25px;
    box-shadow: 0 0 10px rgba(0,0,0,0.08);
    border-radius: 10px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #1e40af;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10000;
}

/* Brand */
.brand a {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.4rem;
    text-decoration: none;
}

/* Nav links */
nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 5px;
    transition: background-color 0.3s;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    width: 28px;
    height: 22px;
    justify-content: space-between;
}

.menu-toggle span {
    display: block;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: 0.3s;
}

/* Hamburger open state */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

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

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Mobile Styles */
@media (max-width: 768px) {
    nav {
        position: fixed;
        top: 60px;
        right: 0;
        width: 240px;
        height: calc(100% - 60px);
        background: #ffffff;
        flex-direction: column;
        padding: 20px;
        transform: translateX(100%);
        border-radius: 0 0 0 12px;
        box-shadow: -2px 0 8px rgba(0,0,0,0.3);
        z-index: 9998;
        overflow-y: auto;
    }

    nav.active {
        transform: translateX(0) !important; /* Force instant change */
    }

    nav a {
        padding: 14px 10px;
        font-size: 1.1rem;
        border-radius: 8px;
        color: #1e40af;
    }

    nav a:not(:last-child) {
        margin-bottom: 15px;
    }

    .menu-toggle {
        display: flex;
    }
}

/* Backdrop overlay */
#backdrop {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 9997;
}

#backdrop.active {
    display: block;
}

/* Footer */
footer {
    background-color: #f1f1f1;
    text-align: center;
    padding: 12px;
    margin-top: 30px;
    font-size: 14px;
    color: #666;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
}

table th, table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: center;
}

table th {
    background-color: #007bff;
    color: white;
}

/* Profile Photo */
img.profile-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
}

/* Enhance viewport meta tag behavior */
@media (max-width: 768px) and (min-resolution: 192dpi) {
    header {
        padding: 0 10px;
        font-size: 14px;
    }
    .brand a {
        font-size: 1.2rem;
    }
    nav a {
        font-size: 0.9rem;
    }
}

/* Handle extreme zoom out */
@media (max-scale: 0.5) {
    header {
        position: relative;
        padding: 10px;
    }
    body {
        padding-top: 0;
    }
    nav {
        position: static;
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: center;
        background: #1e40af;
        padding: 10px 0;
    }
    nav a {
        color: white;
        margin: 0 10px;
    }
    .menu-toggle {
        display: none;
    }
}
@media (max-width: 768px) {
    .demo-button {
        display: none !important;
    }
}