/**
 * Власні стилі для CRM Салон
 */

/* Загальні стилі */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Навігація */
.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

/* Картки статистики */
.stat-card {
    border-left: 4px solid;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-card.primary {
    border-left-color: #0d6efd;
}

.stat-card.success {
    border-left-color: #198754;
}

.stat-card.info {
    border-left-color: #0dcaf0;
}

.stat-card.warning {
    border-left-color: #ffc107;
}

.stat-card.danger {
    border-left-color: #dc3545;
}

.stat-card h3 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.stat-card p {
    margin: 0;
    color: #6c757d;
}

/* Таблиці */
.table {
    background-color: white;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Бейджі статусів */
.badge {
    font-size: 0.85rem;
    padding: 0.35em 0.65em;
}

/* Кнопки */
.btn {
    transition: all 0.2s;
}

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

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Форми */
.form-control:focus, .form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13,110,253,.25);
}

.form-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Модальні вікна */
.modal-header {
    background-color: #0d6efd;
    color: white;
}

.modal-header .btn-close {
    filter: invert(1);
}

/* Сторінка логіну */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    max-width: 400px;
    width: 100%;
}

.login-card .card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-card .card-header {
    background-color: white;
    border-bottom: none;
    text-align: center;
    padding: 2rem;
}

.login-card .card-header i {
    font-size: 3rem;
    color: #0d6efd;
}

.login-card .card-body {
    padding: 2rem;
}

/* Іконки в статистиці */
.stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 20px;
}

/* Календар (простий) */
.calendar-day {
    border: 1px solid #dee2e6;
    padding: 0.5rem;
    min-height: 100px;
    background-color: white;
}

.calendar-day.today {
    background-color: #e7f3ff;
}

.calendar-event {
    font-size: 0.8rem;
    padding: 0.2rem 0.4rem;
    margin-bottom: 0.2rem;
    border-radius: 3px;
    cursor: pointer;
}

/* Алерти */
.alert {
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #198754;
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-info {
    border-left-color: #0dcaf0;
}

/* Footer */
footer {
    margin-top: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .stat-card h3 {
        font-size: 1.5rem;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
    
    /* Покращена обробка модальних вікон на мобільних */
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-dialog-scrollable .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Збільшення області кліку для кнопок на мобільних */
    .btn-group-sm > .btn {
        min-width: 38px;
        min-height: 38px;
        padding: 0.4rem 0.6rem;
    }
    
    /* Покращення для навігаційного меню */
    .navbar-collapse {
        background-color: inherit;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
}

/* Стилі для пристроїв з тач-екраном */
.touch-device .btn,
.touch-device button,
.touch-device a.btn {
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

.touch-device .btn-sm {
    min-height: 38px;
    min-width: 38px;
}

.touch-device .table button,
.touch-device .table .btn {
    padding: 0.4rem 0.6rem;
}

/* Покращення для модальних вікон на мобільних */
@media (max-width: 576px) {
    .modal-dialog {
        max-width: 100%;
        margin: 0;
    }
    
    .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }
    
    .modal-body {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
}

/* Забезпечення що кнопки в таблицях мають достатній розмір для кліку */
.table .btn-group {
    display: flex;
    gap: 2px;
}

.table .btn-group .btn {
    flex: 1;
    padding: 0.375rem 0.5rem;
}

/* Покращення dropdown меню для мобільних */
@media (max-width: 768px) {
    .dropdown-menu {
        position: absolute !important;
        will-change: transform;
    }
    
    .navbar-collapse.show,
    .navbar-collapse.collapsing {
        background-color: rgba(13, 110, 253, 0.95);
        padding: 1rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
    }
}

/* Забезпечення кращої роботи з формами на мобільних */
@media (max-width: 768px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Запобігає zoom на iOS */
    }
}

/* Утиліти */
.cursor-pointer {
    cursor: pointer;
}

.text-decoration-none:hover {
    text-decoration: underline !important;
}

.w-fit {
    width: fit-content;
}

/* Завантаження */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Пусті стани */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}
