/* Unified App CSS - public/css/app.css */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    /* Color scheme */
    --primary-blue: #2d4296;
    --secondary-blue: #4460b8;
    --accent-orange: #ff6b35;
    --accent-orange-light: #ff8659;
    --text-dark: #1a202c;
    --text-gray: #4a5568;
    --text-light: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --border-light: #e2e8f0;
    --success-green: #38a169;
    --warning-yellow: #d69e2e;
    --error-red: #e53e3e;
    --whatsapp-green: #25d366;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    --gradient-accent: linear-gradient(135deg, var(--accent-orange), var(--accent-orange-light));
    --gradient-mixed: linear-gradient(135deg, var(--primary-blue), var(--accent-orange));
    --gradient-whatsapp: linear-gradient(135deg, var(--whatsapp-green), #128c7e);

    /* Shadows */
    --shadow-primary: rgba(45, 66, 150, 0.3);
    --shadow-accent: rgba(255, 107, 53, 0.3);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-whatsapp: rgba(37, 211, 102, 0.3);

    /* Dashboard specific */
    --dashboard-gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --dashboard-gradient-secondary: linear-gradient(45deg, #667eea, #764ba2);
    --dashboard-gradient-accent: linear-gradient(45deg, #f093fb, #f5576c);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', sans-serif;
    scroll-behavior: smooth;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    transition: padding-top 0.4s ease;
}

body.test-bar-hidden {
    padding-top: 64px !important;
}

body:not(.test-bar-hidden) {
    padding-top: calc(60px + 64px) !important;
}

/* ==========================================================================
   Fixed Elements (Scroll to Top & WhatsApp)
   ========================================================================== */
.scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow-primary);
    z-index: 99;
    text-decoration: none;
}

.scroll-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px var(--shadow-primary);
}

.whatsapp-button {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--gradient-whatsapp);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px var(--shadow-whatsapp);
    z-index: 999;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: pulse-whatsapp 2s infinite;
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px var(--shadow-whatsapp);
    color: white;
    text-decoration: none;
}

@keyframes pulse-whatsapp {
    0%, 100% { box-shadow: 0 4px 15px var(--shadow-whatsapp); }
    50% { box-shadow: 0 4px 25px var(--shadow-whatsapp), 0 0 0 10px rgba(37, 211, 102, 0.1); }
}

/* ==========================================================================
   Dashboard Specific Styles
   ========================================================================== */
.gradient-border {
    background: var(--dashboard-gradient-primary);
    padding: 2px;
    border-radius: 12px;
}

.gradient-border-inner {
    background: white;
    border-radius: 10px;
    height: 100%;
}

.glass-effect {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hover-lift {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.notification-slide-in {
    animation: slideInFromTop 0.5s ease-out;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.floating-elements {
    position: relative;
}

.floating-elements::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: var(--dashboard-gradient-secondary);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 6s ease-in-out infinite;
}

.floating-elements::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 60px;
    height: 60px;
    background: var(--dashboard-gradient-accent);
    border-radius: 50%;
    opacity: 0.1;
    animation: float 4s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

.status-online {
    position: relative;
}

.status-online::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10B981;
    border: 2px solid white;
    border-radius: 50%;
    animation: pulse-status 2s infinite;
}

@keyframes pulse-status {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sidebar-item {
    position: relative;
    overflow: hidden;
}

.sidebar-item::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;
}

.sidebar-item:hover::before {
    left: 100%;
}

.wallet-widget {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    transition: all 0.3s ease;
}

.wallet-widget:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

/* Dashboard animations */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

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

.hover-scale:hover {
    transform: scale(1.05);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.gradient-text {
    background: var(--gradient-mixed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Smooth transitions for interactive elements */
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
    .whatsapp-button {
        left: 1rem;
        bottom: 1rem;
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
    }

    .scroll-top {
        right: 1rem;
        bottom: 6rem;
        width: 2.8rem;
        height: 2.8rem;
    }
}

@media (max-width: 640px) {
    .scroll-top,
    .whatsapp-button {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .whatsapp-button {
        font-size: 1.1rem;
    }
}
