/* ARES Platform - UI/UX Enhancements */

/* ============================================
   ANIMATIONS & TRANSITIONS
   ============================================ */

/* Ripple effect for buttons */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ENHANCED BUTTONS
   ============================================ */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, var(--primary) 100%);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading button state */
.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   ENHANCED CARDS & PANELS
   ============================================ */

.glass-panel {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.4s ease-out;
}

.glass-panel:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: var(--border_hover);
}

.stats-card {
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stats-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.stats-card:hover::after {
    left: 100%;
}

/* ============================================
   ENHANCED FORMS
   ============================================ */

.form-control,
select.form-control,
select {
    transition: all 0.3s ease;
    border: 1px solid var(--border-glass);
    background: #000000;
}

select.form-control option,
select option {
    background: #000000;
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.form-control:hover:not(:focus) {
    border-color: var(--border_hover);
}

/* Input with icon */
.form-control.has-icon {
    padding-left: 40px;
}

/* Floating labels */
.form-group {
    position: relative;
}

.form-group label {
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-control:focus + label,
.form-control:not(:placeholder-shown) + label {
    transform: translateY(-20px) scale(0.85);
    color: var(--primary);
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.95); /* Dark bluish-grey background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.toast::before {
    display: none; /* Remove the left border indicator */
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: bold;
}

.toast.success .toast-icon {
    background: #10b981; /* Green background */
    color: #ffffff; /* White checkmark */
}

.toast.warning .toast-icon {
    background: #f59e0b; /* Orange background */
    color: #ffffff;
}

.toast.error .toast-icon {
    background: #ef4444; /* Red background */
    color: #ffffff;
}

.toast.info .toast-icon {
    background: #3b82f6; /* Blue background */
    color: #ffffff;
}

.toast-content {
    flex: 1;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9); /* Light grey/white text */
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7); /* White/light grey close icon */
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.toast-close:hover {
    opacity: 1;
    color: rgba(255, 255, 255, 1);
}

.toast.progress::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    animation: toastProgress linear;
}

@keyframes toastProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ============================================
   SKELETON LOADERS
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

.skeleton-h1 {
    height: 32px;
    width: 60%;
    margin-bottom: 8px;
}

.skeleton-h2 {
    height: 24px;
    width: 80%;
    margin-bottom: 8px;
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 20px;
    border-radius: 12px;
}

/* ============================================
   MODAL ENHANCEMENTS
   ============================================ */

.modal-overlay {
    animation: fadeIn 0.2s ease-out;
    backdrop-filter: blur(4px);
}

.modal-overlay .glass-panel {
    animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay .glass-panel::-webkit-scrollbar {
    width: 8px;
}

.modal-overlay .glass-panel::-webkit-scrollbar-track {
    background: transparent;
}

.modal-overlay .glass-panel::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}

.modal-overlay .glass-panel::-webkit-scrollbar-thumb:hover {
    background: var(--border_hover);
}

/* ============================================
   TABLE ENHANCEMENTS
   ============================================ */

.table-container {
    overflow-x: auto;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

table thead {
    background: rgba(59, 130, 246, 0.1);
}

table thead th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-glass);
}

table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-glass);
}

table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: scale(1.01);
}

table tbody td {
    padding: 16px;
    vertical-align: middle;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.status-success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-success::before {
    background: var(--success);
}

.status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-warning::before {
    background: var(--warning);
}

.status-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-danger::before {
    background: var(--danger);
}

.status-info {
    background: rgba(99, 102, 241, 0.2);
    color: var(--info);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.status-info::before {
    background: var(--info);
}

/* ============================================
   LOADING STATES
   ============================================ */

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 23, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   SIDEBAR ENHANCEMENTS
   ============================================ */

.sidebar {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item {
    position: relative;
    transition: all 0.2s ease;
    border-radius: 8px;
    margin: 4px 0;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s ease;
}

.nav-item:hover {
    background: rgba(59, 130, 246, 0.1);
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.15);
}

.nav-item.active::before {
    height: 60%;
}

/* ============================================
   SEARCH ENHANCEMENTS
   ============================================ */

.search-container {
    position: relative;
}

.search-container .fa-search {
    transition: all 0.2s ease;
}

.search-container:focus-within .fa-search {
    color: var(--primary);
    transform: scale(1.1);
}

/* ============================================
   FILTER BUTTONS
   ============================================ */

.filter-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    font-weight: 500;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ============================================
   SMOOTH SCROLLING
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   RESPONSIVE ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .toast {
        min-width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
    }
    
    .modal-overlay .glass-panel {
        width: calc(100vw - 40px) !important;
        max-width: calc(100vw - 40px) !important;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Screen reader only */
.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
   ============================================ */

.animate-fade-in {
    animation: fadeIn 0.4s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Hover lift effect */
.hover-lift {
    transition: transform 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-4px);
}

/* Glow effect */
.glow {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.glow:hover {
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
}
