/* Components CSS - Reusable UI Components */

/* Advanced Button Variations */
.btn-gradient {
    background: var(--gradient-primary);
    border: none;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-accent);
    transition: left 0.4s ease;
}

.btn-gradient:hover::before {
    left: 0;
}

.btn-gradient span {
    position: relative;
    z-index: 1;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    position: relative;
    overflow: hidden;
}

.btn-outline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--primary-blue);
    transition: width 0.3s ease;
    z-index: 0;
}

.btn-outline:hover::before {
    width: 100%;
}

.btn-outline:hover {
    color: var(--white);
}

.btn-outline span {
    position: relative;
    z-index: 1;
}

.btn-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Advanced Card Components */
.card-interactive {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition-slow);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card-interactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-interactive:hover::before {
    opacity: 0.05;
}

.card-interactive:hover {
    transform: translateY(-10px);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-blue);
}

.card-glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
}

.card-neon {
    background: var(--gray-900);
    border: 2px solid var(--primary-blue);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.card-neon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-lg);
    z-index: -1;
    animation: gradient-shift 3s ease infinite;
    background-size: 400% 400%;
}

/* Badge Components */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-blue);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-gradient {
    background: var(--gradient-primary);
    color: var(--white);
    border: none;
}

/* Progress Components */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 4px;
    transition: width 1s ease-in-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skill-bar {
    margin-bottom: 1.5rem;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.skill-name {
    font-weight: 600;
    color: var(--gray-800);
}

.skill-percentage {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary-blue);
}

/* Modal Components */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1rem 2rem 2rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Tooltip Components */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-900);
    color: var(--white);
    text-align: center;
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1001;
    transition: var(--transition);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border: 5px solid transparent;
    border-top-color: var(--gray-900);
}

.tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Dropdown Components */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--white);
    border: 2px solid var(--gray-200);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.dropdown-toggle:hover {
    border-color: var(--primary-blue);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary-blue);
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* Tab Components */
.tabs {
    border-bottom: 1px solid var(--gray-200);
}

.tab-list {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-600);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-button::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-blue);
    transition: width 0.3s ease;
}

.tab-button:hover,
.tab-button.active {
    color: var(--primary-blue);
}

.tab-button.active::after {
    width: 100%;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Accordion Components */
.accordion-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.accordion-header {
    background: var(--white);
    border: none;
    width: 100%;
    padding: 1.5rem;
    text-align: left;
    font-weight: 600;
    color: var(--gray-800);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.accordion-header:hover {
    background: var(--gray-50);
}

.accordion-icon {
    transition: transform 0.3s ease;
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-item.active .accordion-content {
    padding: 1.5rem;
    max-height: 500px;
}

/* Alert Components */
.alert {
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border-left: 4px solid;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    color: #166534;
    border-left-color: #22c55e;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-left-color: var(--accent-orange);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-left-color: #ef4444;
}

.alert-info {
    background: rgba(99, 102, 241, 0.1);
    color: #3730a3;
    border-left-color: var(--primary-blue);
}

.alert-icon {
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Loading States */
.loading-skeleton {
    background: linear-gradient(
        90deg,
        var(--gray-200) 25%,
        var(--gray-100) 50%,
        var(--gray-200) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}
    /* Preloader visibility control */
    body.loading #preloader { display: flex; }
    body:not(.loading) #preloader { display: none !important; }

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    width: 60%;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gray-500);
}

.empty-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-description {
    color: var(--gray-500);
    margin-bottom: 2rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    color: var(--gray-700);
    text-decoration: none;
    transition: var(--transition);
}

.page-link:hover,
.page-link.active {
    background: var(--primary-blue);
    color: var(--white);
    border-color: var(--primary-blue);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumb-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
}

.breadcrumb-link:hover {
    color: var(--primary-blue);
}

.breadcrumb-separator {
    color: var(--gray-400);
}

.breadcrumb-item:last-child .breadcrumb-link {
    color: var(--gray-800);
    font-weight: 600;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .modal {
        width: 95%;
        margin: 1rem;
    }
    
    .tab-list {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    
    .dropdown-menu {
        left: 0;
        right: 0;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}
