/* 6ix Carwash Management System - Custom Styles */

/* Global placeholder styling - applied to all pages */
input::placeholder, textarea::placeholder, 
.form-control::placeholder, 
input.form-control::placeholder,
textarea.form-control::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
input::-moz-placeholder,
textarea::-moz-placeholder,
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
    opacity: 0.5 !important;
    font-weight: normal !important;
    color: rgba(108, 117, 125, 0.5) !important;
}

/* Force date inputs to show numeric format */
.date-input-en::-webkit-datetime-edit-text,
.date-input-en::-webkit-datetime-edit-month-field,
.date-input-en::-webkit-datetime-edit-day-field,
.date-input-en::-webkit-datetime-edit-year-field {
    font-family: 'Courier New', monospace;
}

.date-input-en::-webkit-inner-spin-button,
.date-input-en::-webkit-clear-button {
    display: none;
}

/* Date input placeholder styling */
.date-input-en:invalid {
    color: #6c757d;
}

input[type="date"].date-input-en:not(:focus):not(:valid) {
    color: transparent;
}

input[type="date"].date-input-en:not(:focus):not(:valid):before {
    content: attr(placeholder);
    color: #6c757d;
    margin-right: 0.5em;
}

/* Modal form input sizing fixes */
.modal-body input[type="date"],
.modal-body input[type="text"],
.modal-body input[type="number"],
.modal-body select,
.modal-body textarea {
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.375rem;
    box-sizing: border-box;
}

/* Ensure consistent date input sizing */
.modal-body .date-input-en {
    min-width: 0;
    flex: 1;
}

/* Fix for Add Monthly Service modal date input alignment - Force override */
.modal-body input[type="date"] {
    width: 100% !important;
    box-sizing: border-box !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* Action card hover effects */
.action-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.action-card .card-body {
    padding: 2rem 1rem;
}

.action-card i {
    transition: transform 0.3s ease;
}

.action-card:hover i {
    transform: scale(1.1);
}

/* Consistent form control styling for modals */
.form-control-consistent,
.form-control-lg {
    width: 100% !important;
    min-height: 3rem !important;
    height: 3rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    border-radius: 0.5rem !important;
}

.modal-body .row .col-md-6 input[type="date"] {
    width: 100% !important;
}

/* Ensure all modal inputs have consistent sizing */
#addServiceModal .modal-body input,
#addServiceModal .modal-body select,
#addServiceModal .modal-body textarea {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Basic layout */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.footer {
    margin-top: auto;
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    transition: all 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
    background-color: var(--bs-secondary-bg);
}

/* 카드 스타일 개선 */
.card {
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--bs-secondary-bg);
    border-bottom: 1px solid var(--bs-border-color);
    font-weight: 600;
}

/* 통계 카드 */
.card.bg-primary,
.card.bg-success,
.card.bg-info,
.card.bg-warning {
    border: none;
}

.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-info .card-body,
.card.bg-warning .card-body {
    padding: 1.5rem;
}

.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-info .card-title,
.card.bg-warning .card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 버튼 그룹 */
.btn-group-vertical .btn {
    margin-bottom: 0.25rem;
}

.btn-group-vertical .btn:last-child {
    margin-bottom: 0;
}

/* 테이블 스타일 */
.table {
    font-size: 0.9rem;
}

.table th {
    font-weight: 600;
    border-top: none;
    border-bottom: 2px solid var(--bs-border-color);
    background-color: var(--bs-secondary-bg);
}

.table td {
    vertical-align: middle;
    border-color: var(--bs-border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--bs-secondary-bg);
}

/* 배지 스타일 */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* 타임라인 컴포넌트 */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--bs-border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-icon {
    position: absolute;
    left: -2rem;
    width: 1.5rem;
    height: 1.5rem;
    background-color: var(--bs-body-bg);
    border: 2px solid var(--bs-border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.timeline-item.completed .timeline-icon {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    color: white;
}

.timeline-item.active .timeline-icon {
    background-color: var(--bs-info);
    border-color: var(--bs-info);
    color: white;
    animation: pulse 2s infinite;
}

.timeline-item.pending .timeline-icon {
    background-color: var(--bs-secondary);
    border-color: var(--bs-secondary);
    color: var(--bs-body-bg);
}

.timeline-content {
    margin-left: 1rem;
}

.timeline-content h6 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

/* 펄스 애니메이션 */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-info-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--bs-info-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-info-rgb), 0);
    }
}

/* 폼 스타일 */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-control-lg {
    font-size: 1.125rem;
    font-weight: 500;
}

/* QR 코드 컨테이너 */
.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    display: inline-block;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 알림 스타일 */
.alert {
    border: none;
    border-radius: 0.5rem;
}

.alert-info {
    background-color: rgba(var(--bs-info-rgb), 0.1);
    color: var(--bs-info);
}

.alert-success {
    background-color: rgba(var(--bs-success-rgb), 0.1);
    color: var(--bs-success);
}

.alert-warning {
    background-color: rgba(var(--bs-warning-rgb), 0.1);
    color: var(--bs-warning);
}

.alert-danger {
    background-color: rgba(var(--bs-danger-rgb), 0.1);
    color: var(--bs-danger);
}

/* 리스트 그룹 */
.list-group-item {
    border-color: var(--bs-border-color);
    background-color: var(--bs-body-bg);
}

.list-group-item:hover {
    background-color: var(--bs-secondary-bg);
}

/* Spinners */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* Empty states */
.empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: var(--bs-secondary);
}

.empty-state i {
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Print styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .card-header {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .qr-container {
        background: white !important;
        box-shadow: none;
    }
}

/* Mobile responsive */
@media (max-width: 767.98px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn-group-vertical {
        width: 100%;
    }
    
    .timeline {
        padding-left: 1.5rem;
    }
    
    .timeline-icon {
        left: -1.5rem;
        width: 1.25rem;
        height: 1.25rem;
    }
    
    .timeline-content {
        margin-left: 0.75rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .btn-group .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* 태블릿 반응형 */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
}

/* 로딩 상태 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    margin: -0.5rem 0 0 -0.5rem;
    border: 2px solid var(--bs-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 상태별 색상 */
.status-waiting {
    color: var(--bs-warning);
}

.status-in-progress {
    color: var(--bs-info);
}

.status-completed {
    color: var(--bs-success);
}

.status-cancelled {
    color: var(--bs-danger);
}

/* 텍스트 크기 조정 */
.text-large {
    font-size: 1.125rem;
}

.text-small {
    font-size: 0.875rem;
}

.text-xs {
    font-size: 0.75rem;
}

/* 여백 조정 */
.mb-half {
    margin-bottom: 0.5rem;
}

.mt-half {
    margin-top: 0.5rem;
}

/* 포커스 상태 개선 */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: none;
}

/* 접근성 개선 */
.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* 스크롤바 스타일 (웹킷 기반 브라우저) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-secondary-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-secondary);
}

/* 다크 모드 대응 */
[data-bs-theme="dark"] .timeline::before {
    background-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .qr-container {
    background: white;
    color: black;
}

/* 애니메이션 효과 */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* 호버 효과 */
.hover-lift:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}

/* 그림자 효과 */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.shadow {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}
