/* =====================================================
   HYDROSISTEM - Components Stylesheet
   ===================================================== */

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--c-gray);
    border-top-color: var(--c-brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.loader-text {
    font-size: 14px;
    color: var(--c-body);
    font-weight: var(--font-weight-medium);
}

/* Timeline Component */
.timeline-container {
    max-width: 900px;
    margin: 0 auto;
}

.timeline-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    padding: 0 16px;
}

.timeline-nav-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--c-white);
    border: 2px solid var(--c-brand);
    border-radius: 50%;
    color: var(--c-brand);
    font-size: 24px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timeline-nav-btn:hover {
    background-color: var(--c-brand);
    color: var(--c-white);
}

.timeline-years {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0;
    flex: 1;
}

.timeline-years::-webkit-scrollbar {
    display: none;
}

.timeline-year {
    flex-shrink: 0;
    padding: 10px 20px;
    font-family: var(--font-base);
    font-size: 14px;
    font-weight: var(--font-weight-semibold);
    background-color: var(--c-white);
    border: 2px solid var(--c-gray);
    border-radius: 50px;
    color: var(--c-dark);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.timeline-year:hover {
    border-color: var(--c-brand);
    color: var(--c-brand);
}

.timeline-year.active {
    background-color: var(--c-brand);
    border-color: var(--c-brand);
    color: var(--c-white);
}

.timeline-cards {
    position: relative;
    min-height: 400px;
}

.timeline-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 32px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.timeline-card.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.timeline-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--c-gray);
}

.timeline-card-year {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--c-brand) 0%, var(--c-brand-light) 100%);
    color: var(--c-white);
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    border-radius: var(--radius-md);
}

.timeline-card-header h3 {
    flex: 1;
    margin: 0;
}

.timeline-card-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-event {
    padding: 16px;
    background-color: var(--c-light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--c-brand);
}

.timeline-event h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--c-brand);
}

.timeline-event p {
    margin-bottom: 0;
    font-size: 14px;
    text-align: left;
}

.timeline-highlight {
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(var(--c-brand-rgb), 0.1) 0%, rgba(var(--c-brand-rgb), 0.05) 100%);
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
    color: var(--c-brand);
    margin-top: 8px;
}

.timeline-progress {
    height: 4px;
    background-color: var(--c-gray);
    border-radius: 2px;
    margin-top: 32px;
    overflow: hidden;
}

.timeline-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--c-brand) 0%, var(--c-brand-light) 100%);
    border-radius: 2px;
    width: 7.14%;
    transition: width var(--transition-normal);
}

/* Modal Component */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    background-color: var(--c-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-lg .modal-content {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--c-gray);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--c-body);
    cursor: pointer;
    transition: color var(--transition-fast);
    line-height: 1;
}

.modal-close:hover {
    color: var(--c-dark);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

.modal-body iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: var(--radius-md);
}

/* All Clients Grid in Modal */
.all-clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 24px;
}

.all-client-item {
    text-align: center;
    padding: 24px 16px;
    background-color: var(--c-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.all-client-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.all-client-item img {
    max-height: 50px;
    margin: 0 auto 12px;
}

.all-client-item p {
    margin: 0;
    font-size: 14px;
    font-weight: var(--font-weight-medium);
    color: var(--c-dark);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background-color: var(--c-white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 10001;
    transform: translateY(100px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.success .toast-icon::before {
    content: '\f00c';
    font-family: 'remixicon';
    color: #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.error .toast-icon::before {
    content: '\f071';
    font-family: 'remixicon';
    color: #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast.warning .toast-icon::before {
    content: '\f05a';
    font-family: 'remixicon';
    color: #f59e0b;
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    font-size: 14px;
    color: var(--c-dark);
}

/* Card Hover Effects */
.card-hover {
    transition: all var(--transition-normal);
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* Image Zoom Effect */
.image-zoom {
    overflow: hidden;
    border-radius: var(--radius-md);
}

.image-zoom img {
    transition: transform var(--transition-slow);
}

.image-zoom:hover img {
    transform: scale(1.1);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--c-gray) 0%, var(--c-light) 50%, var(--c-gray) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: var(--font-weight-semibold);
    border-radius: 50px;
    text-transform: uppercase;
}

.badge-primary {
    background-color: rgba(var(--c-brand-rgb), 0.1);
    color: var(--c-brand);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Icon Box */
.icon-box {
    width: 60px;
    height: 60px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--c-brand-rgb), 0.1);
    color: var(--c-brand);
    font-size: 24px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.icon-box:hover {
    background-color: var(--c-brand);
    color: var(--c-white);
}

/* Divider */
.divider {
    width: 100%;
    height: 1px;
    background-color: var(--c-gray);
    margin: 32px 0;
}

/* Scroll to Top Button */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--c-brand);
    color: var(--c-white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    background-color: var(--c-brand-light);
    transform: translateY(-4px);
}

/* Responsive Components */
@media (max-width: 768px) {
    .timeline-nav {
        padding: 0;
    }
    
    .timeline-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .timeline-year {
        padding: 8px 14px;
        font-size: 13px;
    }
    
    .timeline-card {
        padding: 20px;
    }
    
    .timeline-card-year {
        width: 60px;
        height: 60px;
        font-size: 1.25rem;
    }
    
    .modal-content {
        max-height: 95vh;
        margin: 10px;
    }
    
    .modal-body iframe {
        height: 400px;
    }
    
    .toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
    
    .all-clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}
