/* QuantEngine Global Styles */

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

html, body {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    color: var(--mud-palette-text-primary, #212121);
    background-color: var(--mud-palette-background, #fafafa);
    transition: background-color 0.3s ease, color 0.3s ease;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--mud-palette-surface, #ffffff);
}

::-webkit-scrollbar-thumb {
    background: var(--mud-palette-action-default, #c0c0c0);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--mud-palette-primary, #3f51b5);
}

/* Text Utilities */
.text-primary {
    color: var(--mud-palette-primary, #3f51b5);
}

.text-secondary {
    color: var(--mud-palette-secondary, #f50057);
}

.text-success {
    color: var(--mud-palette-success, #4caf50);
}

.text-warning {
    color: var(--mud-palette-warning, #ff9800);
}

.text-error {
    color: var(--mud-palette-error, #f44336);
}

.text-muted {
    color: var(--mud-palette-text-secondary, rgba(0,0,0,0.6));
}

/* Spacing Utilities */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Flex Utilities */
.d-flex {
    display: flex;
}

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

.align-items-center {
    align-items: center;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

/* Gap Utilities */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--mud-palette-surface, #fff) 0%,
        var(--mud-palette-divider, #e0e0e0) 50%,
        var(--mud-palette-surface, #fff) 100%
    );
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* MudBlazor Overrides */
.mud-appbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mud-drawer {
    border-right: 1px solid var(--mud-palette-divider, #e0e0e0);
}

.mud-drawer-content {
    padding: 1rem;
}

.mud-nav-link {
    border-radius: 4px;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

.mud-nav-link:hover {
    background-color: var(--mud-palette-action-default-hover, rgba(0, 0, 0, 0.04));
}

.mud-nav-link.mud-ripple-nav-link-active {
    background-color: var(--mud-palette-primary-lighten, rgba(63, 81, 181, 0.1));
    color: var(--mud-palette-primary, #3f51b5);
    font-weight: 600;
}

.mud-card {
    border: 1px solid var(--mud-palette-divider, #e0e0e0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mud-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.mud-button {
    text-transform: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.mud-button-root:disabled {
    opacity: 0.6;
}

/* Forms */
.mud-input-control {
    margin-bottom: 1rem;
}

.mud-input-label {
    font-weight: 500;
}

.mud-input {
    border-radius: 4px;
}

.mud-input.mud-input-text {
    background-color: var(--mud-palette-surface, #ffffff);
}

/* Tables */
.mud-table {
    background-color: var(--mud-palette-surface, #ffffff);
}

.mud-table-head {
    background-color: var(--mud-palette-background, #fafafa);
}

.mud-table-row:hover {
    background-color: var(--mud-palette-action-default-hover, rgba(0, 0, 0, 0.04));
}

.mud-table-cell {
    padding: 1rem;
    border-color: var(--mud-palette-divider, #e0e0e0);
}

/* Responsive */
@media (max-width: 600px) {
    body {
        font-size: 13px;
    }

    .mud-drawer {
        width: 100% !important;
        max-width: 90% !important;
    }

    .mud-appbar {
        height: 56px;
    }

    .mud-table-cell {
        padding: 0.75rem 0.5rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

.slide-in {
    animation: slideIn 0.3s ease-in;
}

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

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .mud-appbar,
    .mud-drawer,
    .no-print {
        display: none !important;
    }

    body {
        background: white;
    }
}

/* =============================================
   로그인 페이지 MudTextField 스타일 개선
   ============================================= */

/* MudTextField 입력 필드 */
.mud-input-slot {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.mud-input-slot::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.mud-input-slot:focus {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(63, 81, 181, 0.8) !important;
    color: #ffffff !important;
}

/* MudTextField 라벨 */
.mud-input-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* MudTextField 아웃라인 */
.mud-input-outlined {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.mud-input-outlined:hover {
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.mud-input-outlined:focus-within {
    border-color: rgba(63, 81, 181, 0.8) !important;
}

/* MudCheckBox */
.mud-button-label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* MudButton (로그인) */
.mud-button-filled-primary {
    background-color: rgba(63, 81, 181, 0.9) !important;
}

.mud-button-filled-primary:hover {
    background-color: rgba(63, 81, 181, 1) !important;
    box-shadow: 0 8px 24px rgba(63, 81, 181, 0.4) !important;
}

/* MudAlert (에러) */
.mud-alert {
    background-color: rgba(244, 67, 54, 0.15) !important;
    color: #ff7675 !important;
}

/* HTML input 요소 */
input[type="text"].login-input,
input[type="password"].login-input {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

input[type="text"].login-input::placeholder,
input[type="password"].login-input::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

input[type="text"].login-input:focus,
input[type="password"].login-input:focus {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(63, 81, 181, 0.8) !important;
    color: #ffffff !important;
    outline: none !important;
}

/* =====================================================
   로컬 테스트 환경 스타일 최적화
   ===================================================== */

/* 기본 배경과 텍스트 색상 */
body {
    background: linear-gradient(135deg, #090a15 0%, #12142d 100%);
    color: #ffffff;
}

/* 로그인 셸 전체 */
.login-shell {
    background: linear-gradient(135deg, #0a0b16 0%, #13152e 100%) !important;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 로그인 카드 */
.login-card {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 48px 32px !important;
}

/* MudStack 간격 */
:deep(.mud-stack) {
    gap: 16px !important;
}

/* 모든 입력 필드 */
:deep(.mud-input-slot),
input[type="text"],
input[type="password"],
:deep(.mud-input) {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}

:deep(.mud-input-slot::placeholder),
input[type="text"]::placeholder,
input[type="password"]::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

:deep(.mud-input-slot:focus),
input[type="text"]:focus,
input[type="password"]:focus {
    background-color: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(63, 81, 181, 0.8) !important;
    box-shadow: 0 0 0 3px rgba(63, 81, 181, 0.2) !important;
    outline: none !important;
}

/* 라벨 */
.login-label,
:deep(.mud-input-label),
:deep(.mud-input-label-filled),
:deep(.mud-input-label-outlined) {
    color: rgba(255, 255, 255, 0.7) !important;
    font-weight: 500 !important;
}

/* MudCheckBox */
:deep(.mud-checkbox),
:deep(.mud-checkbox .mud-button-label) {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* MudButton - 로그인 */
:deep(.mud-button-filled-primary) {
    background-color: #3f51b5 !important;
    color: #ffffff !important;
}

:deep(.mud-button-filled-primary:hover) {
    background-color: #5566cc !important;
    box-shadow: 0 8px 24px rgba(63, 81, 181, 0.4) !important;
}

/* MudAlert - 에러 */
:deep(.mud-alert-filled-error) {
    background-color: rgba(244, 67, 54, 0.15) !important;
    color: #ff7675 !important;
}

/* MudText */
:deep(.mud-text),
:deep(.mud-typography) {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* MudAvatar */
:deep(.mud-avatar) {
    background-color: #3f51b5 !important;
}

