/**
 * Help Desk Pro - Modern Design Extensions
 * Professional UI Enhancements - 2026
 */

/* ========================================
   ENHANCED DESIGN TOKENS
   ======================================== */
:root {
    /* Brand Colors - Institutional Slate */
    --brand-primary: #334155;
    --brand-primary-dark: #1e293b;
    --brand-primary-light: #64748b;

    /* Enhanced Shadows with Color */
    --shadow-primary: 0 10px 15px -3px rgba(51, 65, 85, 0.3);
    --shadow-success: 0 10px 15px -3px rgba(5, 150, 105, 0.3);
    --shadow-warning: 0 10px 15px -3px rgba(217, 119, 6, 0.3);
    --shadow-error: 0 10px 15px -3px rgba(220, 38, 38, 0.3);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

    /* Premium Gradients */
    --gradient-card: linear-gradient(to bottom right, #ffffff, #f8fafc);
    --gradient-shimmer: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);

    /* Extended Radius */
    --radius-3xl: 2rem;

    /* Additional Spacing */
    --spacing-3: 0.75rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-12: 3rem;
    --spacing-16: 4rem;

    /* Font Weights */
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Extended Font Sizes */
    --font-size-5xl: 3rem;
    --font-size-6xl: 3.75rem;

    /* Bounce Transition */
    --transition-bounce: 500ms cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ========================================
   MODERN CARD STYLES
   ======================================== */
.card-modern {
    background: var(--gradient-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-shimmer);
    transition: left 0.5s;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.card-modern:hover::before {
    left: 100%;
}

/* ========================================
   ENHANCED BUTTONS
   ======================================== */
.btn-modern {
    position: relative;
    overflow: hidden;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    transition: all var(--transition-base);
}

.btn-modern::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-modern:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary-modern {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-dark) 100%);
    color: white;
    box-shadow: var(--shadow-primary);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(107, 114, 128, 0.4);
}

/* ========================================
   GLASSMORPHISM EFFECTS
   ======================================== */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   MICRO-INTERACTIONS
   ======================================== */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(107, 114, 128, 0.4);
}

/* ========================================
   LOADING STATES
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   ENHANCED FORM INPUTS
   ======================================== */
.input-modern {
    position: relative;
    margin-bottom: 24px;
}

.input-modern input,
.input-modern textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: var(--font-size-base);
    transition: all var(--transition-base);
    background: white;
}

.input-modern input:focus,
.input-modern textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 4px rgba(107, 114, 128, 0.1);
}

.input-modern label {
    position: absolute;
    left: 16px;
    top: 14px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all var(--transition-base);
    background: white;
    padding: 0 4px;
}

.input-modern input:focus+label,
.input-modern input:not(:placeholder-shown)+label {
    top: -10px;
    font-size: var(--font-size-sm);
    color: var(--brand-primary);
    font-weight: var(--font-weight-semibold);
}

/* Friendly Error Styles */
.input-error {
    color: var(--error-color);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: errorBounce 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes errorBounce {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.is-invalid {
    border-color: var(--error-color) !important;
    background-color: rgba(220, 38, 38, 0.02) !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1) !important;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    z-index: 9999;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--error-color);
}

.toast-warning {
    border-left: 4px solid var(--warning-color);
}

.toast-info {
    border-left: 4px solid var(--info-color);
}

/* ========================================
   BADGE ENHANCEMENTS
   ======================================== */
.badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-fast);
}

.badge-modern:hover {
    transform: scale(1.05);
}

/* ========================================
   PROGRESS BARS
   ======================================== */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ========================================
   MODAL IMPROVEMENTS
   ======================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1040;
    animation: fadeIn 0.3s;
}

.modal-content-modern {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 600px;
    margin: 50px auto;
    animation: scaleIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Premium Modal System */
.modal-premium {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-premium.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content-premium {
    background: white;
    width: 100%;
    max-width: 800px;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.modal-hdr-premium {
    background: var(--gradient-primary);
    padding: 25px 35px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-hdr-premium h2 {
    margin: 0;
    color: white;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-close-btn-premium {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close-btn-premium:hover {
    background: white;
    color: var(--primary-color);
    transform: rotate(90deg);
}

.modal-body-premium {
    padding: 35px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Premium Form System */
.form-section-premium {
    margin-bottom: 30px;
}

.section-hl-premium {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-hl-premium::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-100);
}

.form-grid-premium {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group-premium {
    margin-bottom: 18px;
}

.form-label-premium {
    display: block;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.form-label-premium.required::after {
    content: '*';
    color: var(--error-color);
    margin-left: 4px;
}

.form-ctrl-premium {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-100);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    transition: all 0.2s;
    background: var(--gray-50);
}

.form-ctrl-premium:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.modal-footer-premium {
    padding: 20px 35px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

.checkbox-tile-premium {
    background: var(--gray-50);
    border: 2px solid var(--gray-100);
    padding: 12px 18px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-tile-premium:hover {
    border-color: var(--primary-color);
    background: white;
}

.checkbox-tile-premium.active {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */
.focus-visible:focus {
    outline: 3px solid var(--brand-primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.shadow-colored-primary {
    box-shadow: var(--shadow-primary);
}

.shadow-colored-success {
    box-shadow: var(--shadow-success);
}

.shadow-colored-warning {
    box-shadow: var(--shadow-warning);
}

.shadow-colored-error {
    box-shadow: var(--shadow-error);
}

/* ========================================
   RESPONSIVE ENHANCEMENTS
   ======================================== */
@media (max-width: 768px) {
    .card-modern {
        padding: 16px;
        border-radius: 12px;
    }

    .toast {
        left: 16px;
        right: 16px;
        min-width: auto;
    }

    .modal-content-modern {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
}

/* ========================================
   DARK MODE PREPARATION
   ======================================== */
@media (prefers-color-scheme: dark) {
    .card-modern {
        background: linear-gradient(to bottom right, #1e293b, #0f172a);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .glass {
        background: rgba(15, 23, 42, 0.7);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* ========================================
   REDUCED MOTION
   ======================================== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========================================
   TOOLTIPS (Modern CSS)
   ======================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    padding: 8px 12px;
    background: var(--gray-800);
    color: white;
    font-size: var(--font-size-xs);
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1001;
    box-shadow: var(--shadow-xl);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 6px solid transparent;
    border-top-color: var(--gray-800);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: 1001;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-sm);
    color: var(--text-light);
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    color: var(--gray-300);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
    color: var(--brand-primary);
}

.breadcrumb-item.active {
    color: var(--brand-primary);
    font-weight: var(--font-weight-semibold);
}

/* ========================================
   PREMIUM TABLES
   ======================================== */
.table-premium {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px;
    margin-top: -12px;
}

.table-premium tr {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.table-premium tbody tr {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.table-premium tbody tr td:first-child {
    border-top-left-radius: var(--radius-lg);
    border-bottom-left-radius: var(--radius-lg);
}

.table-premium tbody tr td:last-child {
    border-top-right-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

.table-premium tbody tr:hover {
    transform: scale(1.005);
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.ticket-row.selected-row {
    background: var(--gray-100) !important;
    border-left: 4px solid var(--brand-primary) !important;
    transform: scale(1.005);
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
    text-align: center;
    padding: var(--spacing-16) var(--spacing-8);
    background: var(--bg-card);
    border-radius: var(--radius-2xl);
    border: 2px dashed var(--gray-200);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-4);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-300);
    margin-bottom: var(--spacing-4);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.empty-state-title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin: 0;
}

.empty-state-description {
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* ========================================
   NAVBAR ANIMATIONS
   ======================================== */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--brand-primary);
    transform: scaleX(0);
    transition: transform var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

/* ========================================
   COMMAND PALETTE (Spotlight Search)
   ======================================== */
.command-palette {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.command-palette.show {
    opacity: 1;
    visibility: visible;
}

.cp-container {
    width: 100%;
    max-width: 650px;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), var(--shadow-2xl);
    overflow: hidden;
    transform: scale(0.95) translateY(-20px);
    transition: transform var(--transition-base);
}

.command-palette.show .cp-container {
    transform: scale(1) translateY(0);
}

.cp-search-wrapper {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-100);
}

.cp-search-icon {
    font-size: 20px;
    color: var(--gray-400);
}

.cp-input {
    flex: 1;
    border: none;
    padding: 8px 16px;
    font-size: 18px;
    outline: none;
    background: transparent;
    color: var(--text-primary);
}

.cp-results {
    max-height: 450px;
    overflow-y: auto;
    padding: 8px;
}

.cp-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition-fast);
}

.cp-item.selected,
.cp-item:hover {
    background: var(--gray-50);
}

.cp-item-icon {
    width: 40px;
    height: 40px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-primary);
    font-size: 18px;
}

.cp-item.selected .cp-item-icon,
.cp-item:hover .cp-item-icon {
    background: var(--brand-primary);
    color: white;
}

.cp-item-info {
    flex: 1;
}

.cp-item-title {
    font-weight: 600;
    color: var(--text-primary);
    display: block;
}

.cp-item-subtitle {
    font-size: 13px;
    color: var(--text-light);
}

.cp-item-meta {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gray-400);
    letter-spacing: 0.05em;
    padding: 4px 8px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.cp-footer {
    padding: 12px 20px;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-light);
}

.cp-footer kbd {
    background: white;
    border: 1px solid var(--gray-300);
    border-bottom-width: 2px;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: inherit;
    color: var(--text-primary);
}

/* ========================================
   ENHANCED PAGINATION
   ======================================== */
.pagination-container {
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
}

.page-item.active .page-link {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    box-shadow: 0 4px 10px rgba(107, 114, 128, 0.2);
}

.page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gray-50);
}

.page-link:hover:not(.active) {
    background: var(--gray-100);
    transform: translateY(-2px);
}