/* ======= Reusable Component Library ======= */

/* Modern Button Components */
.btn-modern {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 15px rgba(253, 133, 53, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(253, 133, 53, 0.4);
    color: white;
}

.btn-secondary-modern {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary-modern:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(253, 133, 53, 0.3);
}

.btn-success-modern {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
    color: white;
}

.btn-danger-modern {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-danger-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.4);
    color: white;
}

.btn-info-modern {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.btn-info-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
    color: white;
}

/* Button Sizes */
.btn-sm-modern {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
}

.btn-lg-modern {
    padding: 1rem 3rem;
    font-size: 1.125rem;
}

.btn-xl-modern {
    padding: 1.25rem 4rem;
    font-size: 1.25rem;
}

/* Icon Buttons */
.btn-icon-modern {
    width: 50px;
    height: 50px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Loading Button State */
.btn-loading {
    position: relative;
    color: transparent;
    cursor: not-allowed;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Modern Card Components */
.card-modern {
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
}

.card-header-modern {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.card-body-modern {
    padding: 1.5rem;
}

.card-footer-modern {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e9ecef;
}

/* Badge Components */
.badge-modern {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

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

.badge-secondary-modern {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.badge-success-modern {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.badge-danger-modern {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.badge-warning-modern {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.badge-info-modern {
    background: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
}

/* Modern Form Components */
.form-modern {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.form-group-modern {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label-modern {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    display: block;
    font-size: 0.95rem;
}

.form-control-modern {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-control-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(253, 133, 53, 0.1);
    transform: translateY(-1px);
}

.form-control-modern.is-valid {
    border-color: #28a745;
    background: #f8fff9;
}

.form-control-modern.is-invalid {
    border-color: #dc3545;
    background: #fff8f8;
}

/* Floating Label Effect */
.form-floating-modern {
    position: relative;
}

.form-floating-modern .form-control-modern {
    padding: 1.5rem 1.2rem 0.5rem;
}

.form-floating-modern .form-label-modern {
    position: absolute;
    top: 0;
    left: 1.2rem;
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0;
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-floating-modern .form-control-modern:focus ~ .form-label-modern,
.form-floating-modern .form-control-modern:not(:placeholder-shown) ~ .form-label-modern {
    padding-top: 0.5rem;
    padding-bottom: 0;
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Modal Components */
.modal-modern {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content-modern {
    border: none;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.modal-header-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 1.5rem;
    border-bottom: none;
}

.modal-title-modern {
    font-weight: 700;
    margin: 0;
}

.modal-body-modern {
    padding: 2rem;
}

.modal-footer-modern {
    background: #f8f9fa;
    padding: 1rem 2rem;
    border-top: 1px solid #e9ecef;
}

/* Alert Components */
.alert-modern {
    border-radius: 15px;
    border: none;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.alert-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
}

.alert-primary-modern {
    background: rgba(253, 133, 53, 0.1);
    color: #e76f1f;
}

.alert-primary-modern::before {
    background: var(--primary-color);
}

.alert-success-modern {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

.alert-success-modern::before {
    background: #28a745;
}

.alert-danger-modern {
    background: rgba(220, 53, 69, 0.1);
    color: #721c24;
}

.alert-danger-modern::before {
    background: #dc3545;
}

.alert-warning-modern {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.alert-warning-modern::before {
    background: #ffc107;
}

.alert-info-modern {
    background: rgba(23, 162, 184, 0.1);
    color: #0c5460;
}

.alert-info-modern::before {
    background: #17a2b8;
}

/* Progress Components */
.progress-modern {
    height: 12px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-modern {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    transition: width 1s ease-in-out;
    position: relative;
    overflow: hidden;
}

.progress-bar-modern::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: progress-bar-stripes 1s linear infinite;
}

/* Spinner Components */
.spinner-modern {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

/* Tooltip Components */
.tooltip-modern {
    position: relative;
    cursor: pointer;
}

.tooltip-modern::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip-modern::after {
    content: '';
    position: absolute;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top: 5px solid rgba(0, 0, 0, 0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.tooltip-modern:hover::before,
.tooltip-modern:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Dropdown Components */
.dropdown-modern {
    position: relative;
    display: inline-block;
}

.dropdown-toggle-modern {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle-modern:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(253, 133, 53, 0.1);
}

.dropdown-menu-modern {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-modern.active .dropdown-menu-modern {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item-modern {
    padding: 0.8rem 1.2rem;
    color: var(--text-dark);
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
}

.dropdown-item-modern:hover {
    background: #f8f9fa;
    color: var(--primary-color);
    padding-left: 1.5rem;
}

/* Tab Components */
.tabs-modern {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 2rem;
}

.tab-nav-modern {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 1rem;
}

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

.tab-nav-link-modern {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tab-nav-link-modern:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-nav-link-modern.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-content-modern {
    animation: fadeIn 0.3s ease-in-out;
}

.tab-pane-modern {
    display: none;
}

.tab-pane-modern.active {
    display: block;
}

/* Accordion Components */
.accordion-modern {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.accordion-item-modern {
    border: none;
    border-bottom: 1px solid #e9ecef;
}

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

.accordion-header-modern {
    background: #f8f9fa;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--text-dark);
}

.accordion-header-modern:hover {
    background: #e9ecef;
    color: var(--primary-color);
}

.accordion-header-modern.active {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

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

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

.accordion-body-modern {
    padding: 1.5rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Pagination Components */
.pagination-modern {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.page-item-modern {
    border-radius: 50%;
}

.page-link-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    background: white;
}

.page-link-modern:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(253, 133, 53, 0.2);
}

.page-item-modern.active .page-link-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(253, 133, 53, 0.3);
}

/* Avatar Components */
.avatar-modern {
    border-radius: 50%;
    overflow: hidden;
    display: inline-block;
    position: relative;
}

.avatar-sm {
    width: 40px;
    height: 40px;
}

.avatar-md {
    width: 60px;
    height: 60px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

.avatar-xl {
    width: 120px;
    height: 120px;
}

.avatar-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
}

/* Status Indicators */
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.status-online {
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-offline {
    background: #6c757d;
}

.status-busy {
    background: #dc3545;
}

.status-away {
    background: #ffc107;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes slideInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

@keyframes progress-bar-stripes {
    0% { background-position: 1rem 0; }
    100% { background-position: 0 0; }
}

/* Utility Classes */
.fade-in { animation: fadeIn 0.6s ease-in-out; }
.slide-in-up { animation: slideInUp 0.6s ease-out; }
.slide-in-down { animation: slideInDown 0.6s ease-out; }
.scale-in { animation: scaleIn 0.4s ease-out; }

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-modern {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.shadow-modern-lg {
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.12);
}

.border-gradient {
    border: 2px solid transparent;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--primary-color), var(--accent-color)) border-box;
}

/* Responsive Utilities */
@media (max-width: 767.98px) {
    .btn-modern {
        padding: 0.6rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .btn-sm-modern {
        padding: 0.4rem 1rem;
        font-size: 0.8rem;
    }
    
    .btn-lg-modern {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
    
    .btn-xl-modern {
        padding: 1rem 2.5rem;
        font-size: 1.1rem;
    }
    
    .card-header-modern,
    .card-body-modern,
    .card-footer-modern {
        padding: 1rem;
    }
    
    .form-modern {
        padding: 1.5rem;
    }
    
    .modal-body-modern {
        padding: 1.5rem;
    }
    
    .tab-nav-link-modern {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
    
    .accordion-header-modern,
    .accordion-body-modern {
        padding: 1rem;
    }
    
    .page-link-modern {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

@media (max-width: 575.98px) {
    .btn-modern {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }
    
    .tab-nav-modern {
        flex-direction: column;
        gap: 0;
    }
    
    .tab-nav-item-modern {
        margin-bottom: 0;
    }
    
    .tab-nav-link-modern {
        border-bottom: 1px solid #e9ecef;
        border-radius: 0;
    }
    
    .pagination-modern {
        gap: 0.3rem;
    }
    
    .page-link-modern {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }
}

