/* ========================================
   REUSABLE COMPONENTS
   ======================================== */

/* Decorative Orbs */
.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
    pointer-events: none;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    top: 50%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(50px, -50px) scale(1.1);
    }

    50% {
        transform: translate(-30px, 30px) scale(0.9);
    }

    75% {
        transform: translate(30px, 50px) scale(1.05);
    }
}

/* Glassmorphism Card */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

/* Premium Card with Gradient Border */
.premium-card {
    position: relative;
    background: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.premium-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--radius-xl);
    padding: 2px;
    background: var(--gradient-primary);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* Stat Number with Counter Animation */
.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Icon Box */
.icon-box {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

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

.icon-box:hover::before {
    width: 200%;
    height: 200%;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.badge-accent {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
}

.badge-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 1s ease-out;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gradient-primary);
}

.timeline-item {
    position: relative;
    margin-bottom: var(--spacing-xl);
}

.timeline-dot {
    position: absolute;
    left: -46px;
    top: 0;
    width: 16px;
    height: 16px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}

/* Accordion */
.accordion-item {
    background: white;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition-base);
}

.accordion-header {
    padding: var(--spacing-lg);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    transition: var(--transition-base);
}

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

.accordion-icon {
    transition: transform var(--transition-base);
}

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

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

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

.accordion-body {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    color: var(--text-light);
    line-height: 1.7;
}

/* Input Fields */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-dark);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: var(--transition-base);
    background: white;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Alert */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success-color);
    color: #065f46;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error-color);
    color: #991b1b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid var(--primary-color);
    color: #1e3a8a;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--bg-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

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

.tooltip-text {
    visibility: hidden;
    background: var(--text-dark);
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity var(--transition-base);
    white-space: nowrap;
    font-size: 0.875rem;
}

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

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-base);
}

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

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-base);
}

/* Notification UI (site-wide) */
.notif-wrapper { position: relative; margin-left: 12px; }
.notif-bell { background: transparent; border: none; cursor: pointer; font-size: 18px; color: var(--text-dark); position: relative; }
.notif-count { position: absolute; top: -6px; right: -8px; background: var(--error-color); color: white; padding: 2px 6px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.notif-dropdown { position: absolute; right: 0; top: 36px; width: 320px; max-height: 360px; overflow-y: auto; background: var(--bg-white); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px; z-index: 10005; }
.notif-item { display: block; padding: 10px; border-radius: 6px; color: var(--text-dark); text-decoration: none; }
.notif-item:hover { background: var(--bg-light); }
.notif-item.read { opacity: 0.6; }
.notif-text { font-size: 0.95rem; }
.notif-time { font-size: 0.8rem; color: var(--text-light); margin-top: 6px; }
.notif-empty { padding: 12px; text-align: center; color: var(--text-light); }

/* Desktop badge for nav link */
.notif-count-badge {
    display: inline-block;
    margin-left: 8px;
    background: var(--error-color);
    color: white;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

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

/* Breadcrumb */
.breadcrumb {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.breadcrumb-item a {
    color: var(--primary-color);
    transition: var(--transition-base);
}

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

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

/* Pagination */
.pagination {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    align-items: center;
    margin-top: var(--spacing-xl);
}

.pagination-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-base);
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover,
.pagination-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Tabs */
.tabs {
    display: flex;
    gap: var(--spacing-sm);
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--spacing-lg);
}

.tab-btn {
    padding: var(--spacing-md) var(--spacing-lg);
    background: none;
    border: none;
    color: var(--text-light);
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: var(--transition-base);
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-base);
}

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    width: 100%;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}