/* Components CSS - Additional UI Components */

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--dark-card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--dark-border);
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--dark-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--accent-brown), var(--accent-gold-dark));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-title {
    color: var(--text-on-gold);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-on-gold);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--dark-border);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
}

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

/* Dropdowns */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.dropdown-toggle:hover {
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-md);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown.show .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--dark-border);
}

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

.dropdown-item:hover {
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.dropdown-divider {
    height: 1px;
    background: var(--dark-border);
    margin: 0.5rem 0;
}

/* Tabs */
.tabs {
    border-bottom: 2px solid var(--dark-border);
    margin-bottom: var(--space-lg);
}

.tab-list {
    display: flex;
    list-style: none;
    gap: var(--space-md);
}

.tab-item {
    margin-bottom: -2px;
}

.tab-link {
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.tab-link:hover {
    color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.tab-link.active {
    color: var(--accent-gold);
    border-bottom-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Progress bars */
.progress {
    height: 8px;
    background: var(--dark-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: var(--space-sm) 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-gold), var(--accent-brown));
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* Loading spinners */
.spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 3px solid var(--dark-border);
    border-radius: 50%;
    border-top-color: var(--accent-gold);
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}

.spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
}

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

/* Pagination */
.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: var(--space-lg) 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-weight: 500;
}

.page-link:hover {
    color: var(--accent-gold);
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.page-item.active .page-link {
    color: var(--text-on-gold);
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-brown));
    border-color: var(--accent-gold);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Tooltips */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--dark-card);
    color: var(--accent-gold);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    border: 1px solid var(--accent-gold);
    box-shadow: var(--shadow-md);
    pointer-events: none;
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--accent-gold);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* Accordion */
.accordion {
    border: 1px solid var(--dark-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

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

.accordion-header {
    background: rgba(255, 255, 255, 0.02);
    padding: var(--space-md);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.accordion-header:hover {
    background: rgba(212, 175, 55, 0.1);
}

.accordion-title {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

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

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

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-item.active .accordion-content {
    padding: var(--space-md);
    max-height: 1000px;
}

/* Badge notifications */
.badge-notification {
    position: relative;
}

.badge-notification::after {
    content: attr(data-badge);
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-brown));
    color: var(--text-on-gold);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--dark-card);
}

/* Avatar */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-brown));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-gold);
    font-weight: 600;
    font-size: 1rem;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

/* Breadcrumbs */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: var(--space-md) 0;
    list-style: none;
    margin: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--text-light);
}

.breadcrumb-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.breadcrumb-link:hover {
    color: var(--accent-gold);
    text-decoration: underline;
}

.breadcrumb-item.active .breadcrumb-link {
    color: var(--accent-gold);
    font-weight: 600;
}

/* Alerts with icons */
.alert-with-icon {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.alert-icon {
    font-size: 1.25rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.alert-success .alert-icon {
    color: var(--secondary-green);
}

.alert-warning .alert-icon {
    color: var(--secondary-yellow);
}

.alert-danger .alert-icon {
    color: var(--secondary-red);
}

.alert-info .alert-icon {
    color: var(--accent-gold);
}

/* Custom file input */
.custom-file-input {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-file-input input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.custom-file-label {
    display: block;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.custom-file-label:hover {
    border-color: var(--accent-gold);
    background: rgba(212, 175, 55, 0.1);
}

.custom-file-label::after {
    content: 'Browse';
    display: inline-block;
    margin-left: var(--space-sm);
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-brown));
    color: var(--text-on-gold);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Range sliders */
.range-slider {
    width: 100%;
    margin: var(--space-md) 0;
}

.range-slider input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--dark-border);
    border-radius: var(--radius-sm);
    outline: none;
    -webkit-appearance: none;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-brown));
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--dark-card);
    box-shadow: var(--shadow-md);
}

.range-slider input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-brown));
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--dark-card);
    box-shadow: var(--shadow-md);
}

.range-value {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Toggle switches */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--dark-border);
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background: var(--dark-card);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-brown));
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}
