/**
 * ATG ToolHub - Component Styles
 * Reusable UI components for all pages
 * Version: 2.0.0
 */

/* ========================================
   1. NAVBAR COMPONENT
   ======================================== */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.navbar-link {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-link:hover,
.navbar-link.active {
    color: var(--primary-color);
}

/* ========================================
   2. DROPDOWN COMPONENT
   ======================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    border-color: var(--primary-color);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: var(--z-dropdown);
}

.dropdown.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

/* ========================================
   3. CARD VARIATIONS
   ======================================== */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-interactive {
    cursor: pointer;
    user-select: none;
}

.card-interactive:active {
    transform: scale(0.98);
}

.card-gradient {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.card-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
}

/* ========================================
   4. ALERT COMPONENT
   ======================================== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border-left: 4px solid;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.alert-success {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--accent-success);
    color: #166534;
}

.alert-error {
    background: rgba(248, 113, 113, 0.1);
    border-color: var(--accent-error);
    color: #991b1b;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: var(--accent-warning);
    color: #92400e;
}

.alert-info {
    background: rgba(96, 165, 250, 0.1);
    border-color: var(--accent-info);
    color: #1e40af;
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

/* ========================================
   5. PROGRESS BAR
   ======================================== */
.progress {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-bar-animated {
    background: linear-gradient(90deg,
        var(--primary-color) 0%,
        var(--secondary-color) 50%,
        var(--primary-color) 100%
    );
    background-size: 200% 100%;
    animation: gradient 2s ease infinite;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========================================
   6. BREADCRUMB
   ======================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0;
    list-style: none;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb-separator {
    color: var(--text-tertiary);
}

/* ========================================
   7. TABS COMPONENT
   ======================================== */
.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid var(--glass-border);
    margin-bottom: 1.5rem;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease;
}

.tab:hover {
    color: var(--primary-color);
}

.tab.active {
    color: var(--primary-color);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeInUp 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

/* ========================================
   8. ACCORDION
   ======================================== */
.accordion {
    border-radius: 12px;
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--glass-border);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: white;
    cursor: pointer;
    transition: background 0.2s;
}

.accordion-header:hover {
    background: var(--bg-secondary);
}

.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;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
}

.accordion-body {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
}

/* ========================================
   9. PAGINATION
   ======================================== */
.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 2px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========================================
   10. TOOLTIP ENHANCED
   ======================================== */
.tooltip-wrapper {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--text-primary);
    color: white;
    font-size: 0.875rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: var(--z-tooltip);
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--text-primary);
}

.tooltip-wrapper:hover .tooltip-content {
    opacity: 1;
}

/* ========================================
   11. AVATAR
   ======================================== */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.25rem;
}

.avatar-xl {
    width: 72px;
    height: 72px;
    font-size: 1.5rem;
}

.avatar-group {
    display: flex;
    align-items: center;
}

.avatar-group .avatar {
    margin-left: -12px;
    border: 2px solid white;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ========================================
   12. SWITCH TOGGLE
   ======================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border-radius: 34px;
    transition: 0.3s;
}

.switch-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.switch input:checked + .switch-slider {
    background: var(--primary-color);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(22px);
}

/* ========================================
   13. CHECKBOX & RADIO CUSTOM
   ======================================== */
.custom-checkbox,
.custom-radio {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.custom-checkbox input,
.custom-radio input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark,
.radiomark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid var(--glass-border);
    transition: all 0.2s ease;
}

.checkmark {
    border-radius: 4px;
}

.radiomark {
    border-radius: 50%;
}

.custom-checkbox input:checked ~ .checkmark,
.custom-radio input:checked ~ .radiomark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark::after {
    content: '✓';
    color: white;
    font-size: 12px;
    opacity: 0;
}

.custom-checkbox input:checked ~ .checkmark::after {
    opacity: 1;
}

.radiomark::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
}

.custom-radio input:checked ~ .radiomark::after {
    opacity: 1;
}

/* ========================================
   14. SKELETON LOADER
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 80%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-rect {
    border-radius: 8px;
}

/* ========================================
   15. EMPTY STATE
   ======================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    max-width: 400px;
}

/* ========================================
   16. STATS CARD
   ======================================== */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-size: 1.5rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-change {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.stat-change.positive {
    color: var(--accent-success);
}

.stat-change.negative {
    color: var(--accent-error);
}
