/* Component-specific styles */

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background-color: var(--white);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-menu.active {
    max-height: 500px;
    display: block;
}

.mobile-menu ul {
    list-style: none;
    padding: 1rem 0;
}

.mobile-menu ul li {
    padding: 0.5rem 1rem;
}

.mobile-menu ul li a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    display: block;
    padding: 0.5rem 0;
}

.mobile-menu ul li a:hover {
    color: var(--primary-color);
}

.mobile-menu .mobile-actions {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
}

.mobile-menu .mobile-actions .btn {
    width: 100%;
    margin-bottom: 0.5rem;
}

/* Loading States */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* Modal Components */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--white);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-light);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: var(--background-light);
    color: var(--text-dark);
}

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

/* Notification/Alert Components */
.notification {
    position: fixed;
    top: 100px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: var(--white);
    font-weight: 500;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 400px;
}

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

.notification.success {
    background-color: var(--secondary-color);
}

.notification.error {
    background-color: #ef4444;
}

.notification.info {
    background-color: var(--primary-color);
}

.notification i {
    margin-right: 0.5rem;
}

/* Accordion Components */
.accordion {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.accordion-item {
    border-bottom: 1px solid var(--border-color);
}

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

.accordion-header {
    padding: 1.5rem;
    background-color: var(--white);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.accordion-header:hover {
    background-color: var(--background-light);
}

.accordion-header h3 {
    margin: 0;
    color: var(--text-dark);
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: var(--background-light);
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding: 1.5rem;
}

/* Tab Components */
.tabs {
    margin-bottom: 2rem;
}

.tab-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-light);
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-button:hover {
    color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.4s ease;
}

/* Card Components */
.card {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.card-header {
    padding: 1.5rem;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: var(--background-light);
    border-top: 1px solid var(--border-color);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

/* Badge Components */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    text-align: center;
}

.badge-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.badge-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.badge-outline {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
}

/* Progress Bar */
.progress {
    background-color: var(--border-color);
    border-radius: 9999px;
    overflow: hidden;
    height: 8px;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.6s ease;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--text-dark);
    color: var(--white);
    text-align: center;
    border-radius: 6px;
    padding: 5px 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    color: var(--text-light);
}

.breadcrumb .current {
    color: var(--text-dark);
    font-weight: 500;
}

/* Spinner/Loading */
.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-radius: 50%;
    border-left-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

/* Image Overlay */
.image-overlay {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.image-overlay .overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay:hover .overlay {
    opacity: 1;
}

/* Responsive helpers */
@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }
    
    .tab-nav {
        flex-direction: column;
    }
    
    .tab-button {
        border-bottom: none;
        border-right: 3px solid transparent;
        text-align: left;
    }
    
    .tab-button.active {
        border-right-color: var(--primary-color);
        border-bottom-color: transparent;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}