/* Prevent flash of unstyled content */
html {
    visibility: hidden;
}

html.theme-loaded {
    visibility: visible;
}

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


/* Scroll bar styling*/
::-webkit-scrollbar{
    width: 10px;   /*vertical alignment*/
    height: 10px;
}

::-webkit-scrollbar-track {
    background-color: var(--bg-secondary);
    border-radius: 5px;
}


::-webkit-scrollbar-thumb {
    background: var(--text-secondary);
    border-radius: 5px;

}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);

}

html {
    scrollbar-width: thin;
    scrollbar-color: var(--text-secondary) var(--bg-secondary);
}





/* CSS Variables for Theme */
:root {
    /* Light Mode (Default) */
    --bg-primary: #ffffff;
    --bg-secondary: rgba(18, 18, 18, 0.02);
    --text-primary: #121212;
    --text-secondary: rgba(18, 18, 18, 0.6);
    --text-muted: rgba(18, 18, 18, 0.7);
    --border-color: rgba(18, 18, 18, 0.1);
    --border-light: rgba(18, 18, 18, 0.08);
    --border-hover: rgba(18, 18, 18, 0.2);
    --accent-color: #09f;
    --accent-hover: #0088dd;
    --btn-bg: #121212;
    --btn-hover: #000000;
    --shadow-color: rgba(18, 18, 18, 0.12);
    --success-color: #1e7e34;
    --success-bg: rgba(30, 126, 52, 0.1);
    --error-color: #c41e3a;
    --error-bg: rgba(196, 30, 58, 0.1);
}

[data-theme="dark"] {
    /* Dark Mode */
    --bg-primary: #121212;
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --text-primary: #f5f5f5;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.2);
    --accent-color: #3db5ff;
    --accent-hover: #5ec5ff;
    --btn-bg: #f5f5f5;
    --btn-hover: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --success-color: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.15);
    --error-color: #f87171;
    --error-bg: rgba(248, 113, 113, 0.15);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.01em;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation Bar Styles */
.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    position: relative;
    box-sizing: border-box;
}

.nav-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    flex-shrink: 0;
    margin-right: 20px;
}

.nav-logo {
    height: 50px;
    width: auto;
    display: block;
}

.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    padding: 8px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    letter-spacing: -0.01em;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link:hover {
    color: var(--accent-color);
}

.nav-link.active {
    color: var(--accent-color);
}

.nav-link.active::after {
    width: 100%;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 16px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
    transform: rotate(15deg);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .nav-container {
        padding: 20px 32px;
    }

    .container {
        padding: 60px 40px;
        margin-top: 100px;
    }

    .dashboard-container {
        padding: 60px 40px;
        margin-top: 100px;
    }
}

/* Mobile Landscape & Small Tablets */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        padding: 8px;
        font-size: 28px;
        z-index: 1001;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 24px 32px 32px;
        box-shadow: 0 8px 40px var(--shadow-color);
        gap: 20px;
        border-top: 1px solid var(--border-color);
        animation: slideDown 0.3s ease-out;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-link {
        padding: 12px 0;
        font-size: 16px;
    }

    .nav-container {
        padding: 18px 24px;
    }

    .nav-logo {
        height: 42px;
    }

    .container {
        padding: 40px 24px;
        margin-top: 80px;
        max-width: 100%;
    }

    .dashboard-container {
        padding: 40px 24px;
        margin-top: 80px;
        max-width: 100%;
    }

    .home-container {
        padding: 40px 24px;
    }

    .home-container h1 {
        font-size: 40px;
    }

    .home-container p {
        font-size: 16px;
    }

    .header h1 {
        font-size: 32px;
    }

    .header p {
        font-size: 15px;
    }

    .btn-group {
        flex-direction: column;
        gap: 12px;
    }

    .btn-group .btn {
        width: 100%;
        padding: 18px;
        font-size: 16px;
    }

    .user-info {
        padding: 24px;
    }

    .user-detail {
        flex-direction: column;
        gap: 6px;
        padding: 14px 0;
    }

    .user-detail span:first-child {
        font-size: 14px;
        font-weight: 600;
    }

    .user-detail span:last-child {
        font-size: 15px;
    }
}

/* Mobile Portrait */
@media (max-width: 640px) {
    .nav-container {
        padding: 16px 20px;
    }

    .nav-logo {
        height: 38px;
    }

    .container {
        padding: 32px 20px;
        margin-top: 60px;
    }

    .dashboard-container {
        padding: 32px 20px;
        margin-top: 60px;
    }

    .home-container h1 {
        font-size: 32px;
    }

    .header h1 {
        font-size: 28px;
    }

    .header p {
        font-size: 14px;
    }

    .btn {
        padding: 16px;
        font-size: 15px;
    }

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

    .form-group label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .form-group input {
        padding: 15px 16px;
        font-size: 16px; /* 16px prevents zoom on iOS */
    }

    .link-text {
        font-size: 14px;
        margin-top: 28px;
    }

    .alert {
        padding: 14px 18px;
        font-size: 13px;
        margin-bottom: 24px;
    }
}

/* Extra Small Mobile */
@media (max-width: 380px) {
    .container {
        padding: 24px 16px;
        margin-top: 48px;
    }

    .dashboard-container {
        padding: 24px 16px;
        margin-top: 48px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header p {
        font-size: 13px;
    }
}

/* Main Content Wrapper */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    max-width: 1920px;
    margin: 0 auto;
    width: 100%;
}

.container {
    background: var(--bg-primary);
    padding: 80px;
    width: 100%;
    max-width: 520px;
    margin-top: 120px;
    transition: background-color 0.3s ease;
}

.header {
    text-align: center;
    margin-bottom: 48px;
}

.header h1 {
    color: var(--text-primary);
    font-size: 38px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.header p {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    letter-spacing: -0.01em;
}

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

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 10px;
    font-size: 14px;
    letter-spacing: -0.01em;
}

.form-group input {
    width: 100%;
    padding: 16px 18px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.form-group input:hover {
    border-color: var(--border-hover);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

[data-theme="dark"] .form-group input:focus {
    box-shadow: 0 0 0 3px rgba(61, 181, 255, 0.2);
}

/* Password toggle styles */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 18px;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--accent-color);
}

.password-toggle:focus {
    outline: none;
    color: var(--accent-color);
}

.password-toggle .eye-icon {
    pointer-events: none;
    user-select: none;
}

/* Password requirements styles */
.password-requirements {
    margin-top: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.requirements-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.requirements-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.requirement-icon {
    font-size: 12px;
    font-weight: 600;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--error-bg);
    color: var(--error-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.requirement.met {
    color: var(--success-color);
}

.requirement.met .requirement-icon {
    background: var(--success-bg);
    color: var(--success-color);
}

/* Admin badge */
.admin-badge {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #09f 0%, #0066cc 100%);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(0, 153, 255, 0.2);
}

.btn {
    width: 100%;
    padding: 16px;
    background: var(--btn-bg);
    color: var(--bg-primary);
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 16px;
    letter-spacing: -0.01em;
}

.btn:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--shadow-color);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--shadow-color);
}

[data-theme="dark"] .btn {
    color: #121212;
}

.link-text {
    text-align: center;
    margin-top: 32px;
    color: var(--text-secondary);
    font-size: 15px;
    letter-spacing: -0.01em;
}

.link-text a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.link-text a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.alert {
    padding: 16px 20px;
    border-radius: 6px;
    margin-bottom: 28px;
    font-size: 14px;
    border-left: 3px solid;
    letter-spacing: -0.01em;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-color);
    border-left-color: var(--error-color);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.dashboard-container {
    background: var(--bg-primary);
    padding: 80px;
    width: 100%;
    max-width: 720px;
    margin-top: 120px;
    transition: background-color 0.3s ease;
}

.user-info {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 32px;
    margin: 40px 0;
}

.user-info h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.user-detail {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}

.user-detail:last-child {
    border-bottom: none;
}

.user-detail span:first-child {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.user-detail span:last-child {
    color: var(--text-primary);
    font-size: 15px;
    letter-spacing: -0.01em;
}

.btn-logout {
    background: var(--text-secondary);
}

.btn-logout:hover {
    background: var(--text-muted);
}

.home-container {
    text-align: center;
    padding: 0 80px;
    max-width: 1920px;
    margin: 0 auto;
}

.home-container h1 {
    color: var(--text-primary);
    font-size: 56px;
    margin-bottom: 24px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.home-container p {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 48px;
    letter-spacing: -0.01em;
}

.btn-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-group .btn {
    flex: 0 1 auto;
    min-width: 180px;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--btn-bg);
    color: var(--bg-primary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-to-top:hover {
    background: var(--btn-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 24px var(--shadow-color);
}

.scroll-to-top:active {
    transform: translateY(-1px);
}

[data-theme="dark"] .scroll-to-top {
    color: #121212;
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    min-width: 300px;
    max-width: 480px;
    box-shadow: 0 8px 32px var(--shadow-color);
    pointer-events: all;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid;
}

.toast-hiding {
    animation: toastSlideOut 0.3s ease-in forwards;
}

.toast-success {
    background: var(--success-bg);
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.toast-error {
    background: var(--error-bg);
    color: var(--error-color);
    border-left-color: var(--error-color);
}

.toast-info {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-left-color: var(--accent-color);
}

.toast-icon {
    font-size: 18px;
    font-weight: 600;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: inherit;
    opacity: 0.6;
    padding: 0 4px;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* Confirm Dialog */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.confirm-dialog {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.confirm-message {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 24px;
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-btn {
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.confirm-cancel {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.confirm-cancel:hover {
    background: var(--border-light);
}

.confirm-ok {
    background: var(--btn-bg);
    color: var(--bg-primary);
}

.confirm-ok:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
}

[data-theme="dark"] .confirm-ok {
    color: #121212;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 640px) {
    #toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
    }

    .toast {
        min-width: unset;
        max-width: unset;
    }

    .confirm-dialog {
        padding: 24px;
    }

    .confirm-buttons {
        flex-direction: column;
    }

    .confirm-btn {
        width: 100%;
        text-align: center;
    }
}
