/* Critical styles - must be first */
html {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: #023351 !important;
    background: linear-gradient(135deg, #023351 0%, #023351 55%, #044e66 100%) !important;
}

body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
    background-color: #023351 !important;
    background: linear-gradient(135deg, #023351 0%, #023351 55%, #044e66 100%) !important;
}

#app {
    width: 100% !important;
    min-height: 100vh !important;
    background-color: #023351 !important;
    background: linear-gradient(135deg, #023351 0%, #023351 55%, #044e66 100%) !important;
    position: relative;
}

/* Mobile-first responsive design - box-sizing already defined above */

/* Base styles for all pages */
.page-container {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #023351 0%, #023351 55%, #044e66 100%);
    padding: 0;
    margin: 0;
}

/* Notification styles */
.notification-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #DC143C;
    color: white;
    padding: 12px 15px;
    z-index: 1000;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s;
}

.notification-header.show {
    transform: translateY(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Menu grid - mobile first */
.menu-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 20px;
    max-width: 100%;
}

.menu-item {
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 100px;
    justify-content: center;
}

.menu-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.menu-item:active {
    transform: scale(0.95);
}

.menu-item img {
    height: 64px;
    width: auto;
    object-fit: contain;
}

.menu-item label {
    color: white;
    font-weight: bold;
    font-size: 14px;
    margin: 0;
}

/* Page title */
.page-title {
    color: white;
    font-size: 22px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
    margin: 0;
}

/* Form styles */
.form-container {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    color: #E6F7FF;
    font-size: 12px;
    margin-bottom: 6px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 8px;
    background-color: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
}

.form-input::placeholder {
    color: #DDFFFF;
    opacity: 0.7;
}

.form-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.12);
}

/* Select elements */
select.form-input,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: border-color 0.2s, background-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='white' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

select.form-input:focus,
select:focus {
    outline: none;
    border-color: #00D4FF;
    background-color: rgba(255, 255, 255, 0.15);
}

select.form-input option,
select option {
    background-color: #023351;
    color: white;
    padding: 8px;
}

/* Button styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn:active {
    transform: scale(0.95);
}

.btn-primary {
    background-color: #812BF8;
    color: white;
}

.btn-secondary {
    background-color: transparent;
    border: 1px solid white;
    color: white;
}

.btn-success {
    background-color: #00D4FF;
    color: white;
}

/* Header styles */
.page-header {
    padding: 15px;
    background-color: #023351;
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-button {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    background-color: transparent;
    border: 1px solid #00D4FF;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.back-button:hover {
    background-color: rgba(0, 212, 255, 0.2);
}

.header-title {
    flex: 1;
}

.header-title h1 {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.header-title p {
    color: #E6F7FF;
    font-size: 12px;
    margin: 2px 0 0 0;
}

/* Scrollable content */
.scrollable-content {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1;
}

/* Tablet and desktop styles */
@media (min-width: 768px) {
    .menu-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 30px;
        max-width: 1200px;
        margin: 0 auto;
    }

    .menu-item {
        min-height: 120px;
    }

    .menu-item img {
        height: 80px;
    }

    .menu-item label {
        font-size: 16px;
    }

    .form-container {
        padding: 30px;
    }
}

@media (min-width: 1024px) {
    .menu-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 24px;
        padding: 40px;
    }

    .menu-item {
        min-height: 140px;
    }

    .menu-item img {
        height: 96px;
    }
}

/* Loading animation */
@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.06);
    }
}

.slide-in-left {
    animation: slideInLeft 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-in-right {
    animation: slideInRight 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hide loading progress indicator */
.loading-progress {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.loading-progress-text {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

#app > .loading-progress,
#app > .loading-progress-text {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Blazor error UI */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}
