/**
 * UniNexus AI - Main Stylesheet v2.0
 * ================================
 * Professional UI Components
 */

/* ========================================
   Base & Reset
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* ========================================
   Scrollbar Styles
   ======================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1, #8b5cf6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #818cf8, #a78bfa);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #6366f1 #1e293b;
}

/* ========================================
   Animations
   ======================================== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes slideUp {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes slideDown {
    from { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-5px); }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(4); opacity: 0; }
}

/* Animation Classes */
.float-animation { animation: float 3s ease-in-out infinite; }
.slide-up { animation: slideUp 0.3s ease-out; }
.slide-down { animation: slideDown 0.3s ease-out; }
.fade-in { animation: fadeIn 0.3s ease-out; }
.fade-out { animation: fadeOut 0.3s ease-out forwards; }
.pulse-animation { animation: pulse 2s ease-in-out infinite; }
.shimmer { 
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.spin { animation: spin 1s linear infinite; }
.bounce { animation: bounce 1s ease-in-out infinite; }

/* ========================================
   Gradient Backgrounds
   ======================================== */
.gradient-bg {
    background: linear-gradient(-45deg, #1e3a8a, #3b82f6, #0891b2, #1e40af, #6366f1);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.gradient-bg-purple {
    background: linear-gradient(-45deg, #581c87, #7c3aed, #6366f1, #8b5cf6);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

.gradient-text {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   Glass Morphism Effects
   ======================================== */
.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-light {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
}

/* ========================================
   Chat Components
   ======================================== */
.chat-bubble-ai {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    border-radius: 20px 20px 20px 4px;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.chat-bubble-user {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: 20px 20px 4px 20px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.chat-bubble-system {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
}

.chat-bubble-me {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.chat-bubble-other {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    border-radius: 18px 18px 18px 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #3b82f6;
    border-radius: 50%;
    animation: typing 1s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* ========================================
   FAQ Components
   ======================================== */
.faq-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.faq-card:hover {
    transform: translateX(-5px);
    box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
    border-color: rgba(59, 130, 246, 0.5) !important;
}

.faq-scroll-container {
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 #1e293b;
}

.faq-scroll-container::-webkit-scrollbar {
    width: 8px;
}

.faq-scroll-container::-webkit-scrollbar-track {
    background: #1e293b;
    border-radius: 4px;
}

.faq-scroll-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
}

/* ========================================
   Windows 11 Style Systems Scroller
   ======================================== */
.win11-systems {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    overflow: hidden;
}

.win11-systems-header {
    background: rgba(15, 23, 42, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.win11-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.win11-tab {
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(30, 41, 59, 0.45);
    color: rgba(226, 232, 240, 0.85);
    transition: all 0.2s ease;
    user-select: none;
    cursor: pointer;
}

.win11-tab:hover {
    border-color: rgba(59, 130, 246, 0.5);
    background: rgba(30, 41, 59, 0.65);
    color: #fff;
}

.win11-tab.active {
    border-color: rgba(59, 130, 246, 0.55);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.55), rgba(59, 130, 246, 0.35));
    color: #fff;
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.18);
}

.win11-strip-wrap {
    position: relative;
}

.win11-strip {
    direction: ltr;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 16px;
    display: flex;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.win11-strip::-webkit-scrollbar {
    height: 10px;
}

.win11-strip::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 999px;
}

.win11-strip::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.65), rgba(139, 92, 246, 0.65));
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.35);
}

.win11-card {
    scroll-snap-align: start;
    min-width: 170px;
    width: 170px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(30, 41, 59, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    transition: all 0.18s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.win11-card::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.35), transparent 70%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.win11-card:hover {
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 18px 55px rgba(59, 130, 246, 0.18);
    background: rgba(30, 41, 59, 0.70);
}

.win11-card:hover::before {
    opacity: 1;
}

.win11-card-inner {
    direction: rtl;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}

.win11-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.25);
    overflow: hidden;
}

.win11-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.win11-fallback {
    font-size: 13px;
    font-weight: 800;
    color: rgba(191, 219, 254, 0.95);
}

.win11-title {
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.35;
}

.win11-sub {
    color: rgba(148, 163, 184, 0.9);
    font-size: 11px;
    margin-top: 4px;
    direction: ltr;
    text-align: right;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.win11-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: rgba(226, 232, 240, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    z-index: 10;
}

.win11-nav-btn:hover {
    border-color: rgba(59, 130, 246, 0.55);
    background: rgba(15, 23, 42, 0.75);
    color: #fff;
}

.win11-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.win11-nav-left {
    left: 12px;
}

.win11-nav-right {
    right: 12px;
}

/* Fading edges */
.win11-strip-wrap::before,
.win11-strip-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 2;
}

.win11-strip-wrap::before {
    left: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0));
}

.win11-strip-wrap::after {
    right: 0;
    background: linear-gradient(270deg, rgba(15, 23, 42, 0.85), rgba(15, 23, 42, 0));
}

/* ========================================
   Button Styles
   ======================================== */
.btn-primary {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(30, 41, 59, 0.8);
    color: #e2e8f0;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(30, 41, 59, 1);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ========================================
   Form Styles
   ======================================== */
.form-input {
    width: 100%;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    color: #e2e8f0;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder {
    color: #64748b;
}

/* ========================================
   Card Styles
   ======================================== */
.card {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

/* ========================================
   Badge Styles
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ========================================
   Loading States
   ======================================== */
.skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    animation: slideDown 0.3s ease-out;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.toast-success {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.toast-error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-info {
    background: rgba(99, 102, 241, 0.9);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* ========================================
   Modal Styles
   ======================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

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

.modal-content {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

/* ========================================
   Tooltip Styles
   ======================================== */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background: rgba(15, 23, 42, 0.95);
    color: #e2e8f0;
    font-size: 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .win11-card {
        min-width: 150px;
        width: 150px;
    }
    
    .win11-nav-left {
        left: 8px;
    }
    
    .win11-nav-right {
        right: 8px;
    }
    
    .faq-scroll-container {
        max-height: 360px;
    }
    
    .chat-bubble-me,
    .chat-bubble-other {
        max-width: 90% !important;
    }
}

@media (max-width: 640px) {
    .glass-effect {
        border-radius: 12px;
    }
    
    .win11-systems {
        border-radius: 16px;
    }
    
    .win11-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden;
}

.text-gradient {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Focus styles for accessibility */
*:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
}

/* Selection styles */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: inherit;
}
