/**
 * Styly pro modernizovaný BUF formulář
 */

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    width: 100%;
    animation: modalSlideIn 0.3s ease-out;
}

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

/* Notifikace */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-out;
    z-index: 10000;
    max-width: 350px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: #10b981;
}

.notification-error {
    background: #ef4444;
}

.notification-info {
    background: #3b82f6;
}

/* Accordion animace */
#buf_accord_vklad {
    transition: all 0.3s ease-out;
}

#buf_accord_vklad.show {
    opacity: 1;
}

/* Responzivní design */
@media (max-width: 768px) {
    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .summary-cards {
        flex-direction: column;
    }
    
    .summary-card {
        margin-bottom: 10px;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .building-finance-wrapper {
        padding: 10px;
    }
    
    .finance-header {
        flex-direction: column;
        gap: 10px;
    }
}

/* Tabulka - hover efekty */
.building-row {
    transition: all 0.2s ease;
}

.building-row:hover {
    background-color: #f0f9ff;
    transform: translateX(2px);
}

/* Tlačítka */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

/* Animace pro řazení tabulky */
th[data-sortable] {
    position: relative;
    padding-right: 25px;
}

th[data-sortable]::after {
    content: '↕';
    position: absolute;
    right: 8px;
    color: #9ca3af;
    font-size: 12px;
}

th[data-sortable].sorted-asc::after {
    content: '↑';
    color: #3b82f6;
}

th[data-sortable].sorted-desc::after {
    content: '↓';
    color: #3b82f6;
}

/* Highlight nových řádků */
@keyframes highlightNew {
    0% {
        background-color: #fef3c7;
    }
    100% {
        background-color: transparent;
    }
}

.new-row {
    animation: highlightNew 2s ease-out;
}

/* Print styly */
@media print {
    .btn,
    .finance-header button,
    .btn-close {
        display: none !important;
    }
    
    .building-finance-wrapper {
        box-shadow: none;
        border: 1px solid #d1d5db;
    }
    
    .modal-overlay {
        position: static;
        background: none;
    }
}