/* Regular */
@font-face {
    font-family: 'Cera Pro';
    src: url('../fonts/Cera_Pro/Cera Pro Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Black */
@font-face {
    font-family: 'Cera Pro';
    src: url('../fonts/Cera_Pro/Cera Pro Black.otf') format('opentype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --primary: #002848;
    --primary-hover: #003a6b;
    --secondary: #2A2A3E;
    --secondary-hover: #3A3A4E;
    --accent-blue: #87bae4;
    --accent-green: #7ED321;
    --accent-purple: #9C27B0;
    --background: #F5F7FA;
    --surface: #FFFFFF;
    --text: #1A1A1A;
    --text-muted: #757575;
    --border: #E8E8E8;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    --font-family: 'Cera Pro', sans-serif;
    --font-family-heading: 'Cera Pro', sans-serif;
}

:host {
    font-family: var(--font-family);
    color: var(--text);
    display: block;
    box-sizing: border-box;
}

* {
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable both-edges;
}

body {
    font-family: var(--font-family);
    background-color: var(--background);
    margin: 0;
    padding: 20px;
    color: var(--text);
    min-height: 100vh;
}

body.dialog-open {
    overflow: hidden;
    position: fixed;
    left: 0;
    right: 0;
}

button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 20px;
    font-weight: 400;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 40, 72, 0.25);
    user-select: none;
    -webkit-user-select: none;
}

button:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 8px 16px rgba(0, 40, 72, 0.35);
}

button:active {
    transform: translateY(0);
}

button:focus {
    outline: none;
}

button:focus-visible {
    outline: 2px solid var(--secondary);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(42, 42, 62, 0.2);
}

button.secondary {
    background-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 40, 72, 0.2);
    font-family: var(--font-family-heading);
    font-weight: 900;
}

button.secondary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 8px 16px rgba(0, 40, 72, 0.25);
}

input,
select {
    width: 100%;
    padding: 16px;
    background-color: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: 18px;
    font-family: var(--font-family);
    font-size: 1rem;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 40, 72, 0.1);
}

input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.card {
    background: var(--surface);
    border-radius: 32px;
    padding: 28px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

h1,
h2,
h3 {
    color: var(--primary);
    margin-top: 0;
    font-family: var(--font-family-heading);
    font-weight: 900;
    letter-spacing: -0.02em;
}

p {
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 1.05rem;
}

.error {
    color: #D32F2F;
    font-size: 0.95rem;
    font-weight: 500;
    margin: 16px 0px;
    background: #FFEBEE;
    padding: 12px 16px;
    border-radius: 12px;
    border-left: 4px solid #D32F2F;
}

.error:empty {
    display: none;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding-bottom: 40px;
}

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

h1 {
    color: var(--primary);
    font-size: 2.4rem;
    font-weight: 900;
    margin: 0;
}

#auth-controls {
    display: flex;
    align-items: center;
}

#logout-btn,
#profile-btn,
#home-btn {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

#logout-btn:hover,
#profile-btn:hover,
#home-btn:hover {
    background-color: #fcfcfc;
    border-color: var(--text-muted);
}

#profile-btn.active,
#home-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background-color: rgba(0, 40, 72, 0.04);
}

#user-menu-container {
    position: relative;
    display: none;
    /* Hidden on desktop by default */
}

#user-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface);
    box-shadow: var(--shadow);
}

#user-icon-btn svg {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

#user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    overflow: hidden;
    z-index: 100;
}

#user-dropdown.show {
    display: block;
}

.dropdown-action-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 12px 16px;
    text-align: left;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text);
    font-weight: 600;
    font-family: var(--font-family);
    box-shadow: none;
    border-radius: 0;
}

.dropdown-action-btn:hover {
    background: #f5f5f5;
    box-shadow: none;
}

.dropdown-action-btn.active {
    background-color: rgba(0, 40, 72, 0.08);
    color: var(--primary);
}

@media (max-width: 768px) {

    #logout-btn,
    #profile-btn,
    #home-btn {
        display: none !important;
    }

    #user-menu-container {
        display: block;
    }
}

@media (max-width: 600px) {
    .card {
        padding: 24px;
        border-radius: 28px;
    }

    button {
        width: 100%;
        padding: 16px;
    }
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    padding: 20px;
}

.modal.active {
    display: flex;
}

/* Dialog Component Styles */
.dialog-box {
    margin: auto;
    padding: 0;
    border: none;
    border-radius: 32px;
    background: var(--surface);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
    max-width: 90vw;
    animation: dialogOpen 0.2s ease-out forwards;
}

.dialog-box::backdrop {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    animation: backdropOpen 0.2s ease-out forwards;
}

.dialog-box.closing {
    animation: dialogClose 0.2s ease-in forwards;
    pointer-events: none;
}

.dialog-box.closing::backdrop {
    animation: backdropClose 0.2s ease-in forwards;
}

@keyframes dialogOpen {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes dialogClose {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
}

@keyframes backdropOpen {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes backdropClose {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}