/* styles/modals-tabs.css - Стилі для модальних вікон і вкладок */

/* МОДАЛЬНІ ВІКНА */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: white;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    max-height: 95vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: modalSlideIn 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: #3498db;
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}

.modal-header h2,
.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-radius: 0 0 10px 10px;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* Кнопка закриття */
.close,
.modal-close {
    color: rgba(255,255,255,0.8);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    background: none;
    border: none;
    line-height: 1;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close:hover,
.modal-close:hover {
    color: white;
    transform: scale(1.1);
}

/* Великі модальні вікна */
.modal-lg .modal-content {
    max-width: 900px;
}

.modal-xl .modal-content {
    max-width: 1200px;
}

.modal-large .modal-content {
    max-width: 1000px;
    width: 95%;
}

/* Маленькі модальні вікна */
.modal-sm .modal-content {
    max-width: 400px;
}

/* ВКЛАДКИ */
.tabs {
    display: flex;
    background: white;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin: 10px 0;
}

.tab {
    flex: 1;
    background: #ecf0f1;
    color: #2c3e50;
    text-align: center;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.tab:hover:not(.active) {
    background: #d5dbdb;
    transform: translateY(-2px);
}

.tab.active {
    background: #3498db;
    color: white;
    box-shadow: 0 -2px 8px rgba(52, 152, 219, 0.3);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.5);
}

/* Вертикальні вкладки */
.tabs-vertical {
    flex-direction: column;
    width: 250px;
    border-radius: 10px 0 0 10px;
}

.tabs-vertical .tab {
    text-align: left;
    border-radius: 0;
}

.tabs-vertical .tab.active::after {
    width: 3px;
    height: 100%;
    top: 0;
    right: 0;
    left: auto;
    bottom: auto;
}

/* Контент вкладок */
.tab-content {
    display: none;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
    animation: tabFadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Контейнер для вертикальних вкладок */
.tabs-container-vertical {
    display: flex;
    gap: 0;
}

.tabs-container-vertical .tab-content {
    flex: 1;
    border-radius: 0 10px 10px 0;
}

/* Індикатори вкладок */
.tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #3498db;
    transition: all 0.3s ease;
    border-radius: 3px 3px 0 0;
}

/* Бейджі на вкладках */
.tab-badge {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    margin-left: 0.5rem;
    font-weight: bold;
}

.tab.active .tab-badge {
    background: rgba(255,255,255,0.3);
}

/* АКОРДЕОН (альтернатива вкладкам на мобільних) */
.accordion {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.accordion-item {
    border-bottom: 1px solid #e9ecef;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    user-select: none;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-header.active {
    background: #3498db;
    color: white;
}

.accordion-toggle {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.accordion-header.active .accordion-toggle {
    transform: rotate(180deg);
}

.accordion-content {
    display: none;
    padding: 1.5rem;
    background: white;
    animation: accordionSlideDown 0.3s ease;
}

.accordion-content.active {
    display: block;
}

@keyframes accordionSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
}

/* Адаптивність */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1% auto;
        max-height: 98vh;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 1rem;
    }
    
    /* Вкладки стають акордеоном на мобільних */
    .tabs-mobile-accordion {
        display: none;
    }
    
    .tabs {
        flex-direction: column;
        border-radius: 10px;
    }
    
    .tab {
        border-radius: 0;
        text-align: left;
        padding: 0.75rem 1rem;
    }
    
    .tab-content {
        border-radius: 0;
        padding: 1rem;
    }
    
    /* Вертикальні вкладки стають горизонтальними */
    .tabs-vertical {
        flex-direction: row;
        width: 100%;
        border-radius: 10px 10px 0 0;
    }
    
    .tabs-container-vertical {
        flex-direction: column;
    }
    
    .tabs-container-vertical .tab-content {
        border-radius: 0 0 10px 10px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        max-height: 98vh;
        margin: 1% auto;
    }
    
    .modal-header h2,
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-header,
    .modal-footer {
        padding: 0.75rem 1rem;
    }
    
    .modal-body {
        padding: 0.75rem 1rem;
    }
    
    .close {
        font-size: 1.5rem;
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .tabs {
        flex-wrap: wrap;
    }
    
    .tab {
        flex: 1 1 50%;
        min-width: 120px;
    }
}

/* Стилі для плавної прокрутки в модальних вікнах */
.modal-body {
    scrollbar-width: thin;
    scrollbar-color: #bdc3c7 #ecf0f1;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #ecf0f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Додаткові стилі для великих модальних вікон */
.modal-large .modal-body {
    padding: 1.5rem 2rem;
}

@media (max-width: 768px) {
    .modal-large .modal-body {
        padding: 1rem;
    }
}

/* Стилі для повідомлень у модальних вікнах */
.modal .error-message {
    background: #fee;
    color: #c0392b;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: none;
    border-left: 4px solid #e74c3c;
}

.modal .success-message {
    background: #eafaf1;
    color: #27ae60;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: none;
    border-left: 4px solid #27ae60;
}

/* Стилі для форми зміни пароля */
#change-password-modal .form-group small {
    color: #7f8c8d;
    font-size: 0.85em;
    margin-top: 0.25rem;
    display: block;
}