/* Please add your custom styles here */

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background-color: #f8f9fa;
}

/* Prevent flicker during Blazor initialization */
#blazor-error-ui {
    display: none;
}

/* Transitions removed to prevent flicker */
.table-responsive {
    min-height: 300px;
    /* transition removed */
}

.card {
    /* transition removed */
}

.page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
}

.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
    width: 250px;
}

.sidebar * {
    max-width: none !important;
}

.main {
    padding: 2rem;
    min-height: 100vh;
    background-color: #f8f9fa;
    flex: 1;
    width: 0;
    min-width: 0;
}

/* 모든 컨테이너 요소가 100%를 넘지 않도록 */
.container, .container-fluid, .row {
    max-width: 100%;
    /* overflow-x: hidden; */
}

/* 스크롤 방지 강화 - 특정 요소만 적용 */

.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col-md-6, .col-12, [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Last Sync 카드에서 텍스트 오버플로우 방지 */
.card .row .col-md-6 {
    word-break: break-word;
    overflow-wrap: break-word;
}

.card .text-end {
    text-align: right;
}

/* 모바일 반응형 */
@media (max-width: 768px) {
    .page {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .main {
        width: 100%;
        padding: 1rem;
    }
    
    /* Last Sync 카드에서 텍스트 정렬 */
    .card .text-end {
        text-align: left !important;
        margin-top: 0.5rem;
    }
    
    /* 카드와 버튼들도 모바일에서 100%를 넘지 않도록 */
    .card, .btn {
        word-wrap: break-word;
    }
    
    /* 테이블도 스크롤 방지 */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    small, .small {
        font-size: 0.8rem;
        word-break: break-word;
    }
}

.sidebar .nav-link {
    color: #333 !important;
    padding: 12px 20px;
    margin-bottom: 2px;
    border-radius: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    width: auto;
    max-width: none;
}

.sidebar .nav-link:hover {
    background-color: rgba(255,255,255,0.1) !important;
    color: #333 !important;
    transform: translateX(5px) !important;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 131, 182, 0.2) !important;
    color: #333 !important;
    border-left: 4px solid #FF83B6;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
    color: inherit !important;
    flex-shrink: 0;
}

.sidebar .nav-link span {
    color: inherit !important;
    white-space: nowrap;
    flex: 1;
}


.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    width: 100%;
}

.card-body {
    padding: 1rem;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-header {
    background: white;
    border-bottom: 2px solid #e9ecef;
    border-radius: 12px 12px 0 0 !important;
    padding: 1.5rem;
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 0.75rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.table thead th {
    background: #f8f9fa;
    border: none;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    padding: 1rem;
    border: none;
    border-bottom: 1px solid #e9ecef;
}

.badge {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.5em 0.8em;
}

.text-primary { color: #667eea !important; }
.text-success { color: #51cf66 !important; }
.text-danger { color: #ff6b6b !important; }
.text-warning { color: #ffd43b !important; }
.text-info { color: #339af0 !important; }

.bg-primary { background-color: #667eea !important; }
.bg-success { background-color: #51cf66 !important; }
.bg-danger { background-color: #ff6b6b !important; }
.bg-warning { background-color: #ffd43b !important; }
.bg-info { background-color: #339af0 !important; }

/* Loading spinner */
.spinner-border {
    color: #667eea;
}

/* Alert improvements */
.alert {
    border-radius: 10px;
    border: none;
    padding: 1rem 1.5rem;
    color: #000 !important;
}

.alert-success {
    background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
    color: white !important;
}

.alert-danger {
    background: linear-gradient(135deg, #ff6b6b 0%, #fa5252 100%);
    color: white !important;
}

.alert-info {
    background: linear-gradient(135deg, #339af0 0%, #228be6 100%);
    color: white !important;
}

.alert-info * {
    color: white !important;
}

.alert-success * {
    color: white !important;
}

.alert-danger * {
    color: white !important;
}

/* Navigation brand */
.navbar-brand {
    font-weight: 700;
    color: #333 !important;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    width: 100%;
    display: block;
}

.navbar-brand:hover {
    transform: none !important;
}

.navbar-brand a:hover {
    transform: none !important;
}

.navbar-brand h5 {
    color: #333 !important;
}

.navbar-brand i {
    color: #FF83B6 !important;
}

/* Footer */
.sidebar-footer {
    padding: 1.5rem;
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
}

.sidebar-footer small {
    color: rgba(255,255,255,0.7);
}

#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;
}