/**
 * 🎨 ENHANCED VISUAL DESIGN
 * Beautiful enhancements for the existing layout
 */

/* ============================================
   🌟 ENHANCED DASHBOARD HEADER
   ============================================ */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3) !important;
    backdrop-filter: blur(10px);
    border: none !important;
}

.navbar-brand {
    font-weight: 700 !important;
    letter-spacing: -0.5px;
}

/* Token/Balance Cards Enhancement */
.card.text-white {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: transform 0.3s ease;
}

.card.text-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ============================================
   🎯 INSTANCE LIST ENHANCEMENT
   ============================================ */
.sidebar {
    background: rgba(248, 249, 250, 0.95) !important;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 20px 15px !important;
}

/* Instance buttons redesign */
.instance-button {
    background: white !important;
    border: 1px solid rgba(102, 126, 234, 0.1) !important;
    position: relative;
    overflow: hidden;
    margin-bottom: 12px !important;
    transition: all 0.3s ease !important;
}

.instance-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s ease;
}

.instance-button:hover::before {
    left: 100%;
}

.instance-button:hover {
    transform: translateX(5px);
    border-color: rgba(102, 126, 234, 0.3) !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2) !important;
}

.instance-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4) !important;
}

.instance-button.active h6,
.instance-button.active small {
    color: white !important;
}

/* Instance status indicators */
.instance-button .text-success::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #48bb78;
    border-radius: 50%;
    margin-right: 5px;
    animation: pulse 2s infinite;
}

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

/* ============================================
   🎨 ACTION BUTTONS ENHANCEMENT
   ============================================ */
#add-instance-btn,
#add-instance-mobile-btn,
#add-first-instance-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease !important;
}

#add-instance-btn::after,
#add-instance-mobile-btn::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;
}

#add-instance-btn:active::after,
#add-instance-mobile-btn:active::after {
    width: 300px;
    height: 300px;
}

/* Icon buttons enhancement */
.btn-outline-primary,
.btn-outline-success,
.btn-outline-warning,
.btn-outline-danger {
    border-width: 2px !important;
    transition: all 0.3s ease !important;
}

.btn-outline-primary:hover,
.btn-outline-success:hover,
.btn-outline-warning:hover,
.btn-outline-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   📱 MOBILE RESPONSIVE IMPROVEMENTS
   ============================================ */
@media (max-width: 768px) {
    .sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        height: 100vh;
        width: 80%;
        max-width: 300px;
        transform: translateX(-100%);
        transition: transform 0.3s ease !important;
        z-index: 1050;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    /* Mobile menu toggle */
    .navbar-toggler {
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
    }
    
    /* Floating action button style for mobile */
    #add-instance-mobile-btn {
        position: fixed !important;
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
        border-radius: 50% !important;
        padding: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
        z-index: 1040;
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4) !important;
    }
    
    #add-instance-mobile-btn span {
        display: none;
    }
    
    #add-instance-mobile-btn i {
        font-size: 24px;
    }
}

/* ============================================
   🌈 CARD ENHANCEMENTS
   ============================================ */
.card {
    border: none !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.3s ease !important;
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
}

/* Main content area cards */
.main-content .card {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
}

/* ============================================
   ✨ MODAL ENHANCEMENTS
   ============================================ */
.modal-content {
    border: none !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================
   🎭 FORM ENHANCEMENTS
   ============================================ */
.form-control,
.form-select {
    border: 2px solid #e9ecef !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    padding: 10px 15px !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

/* ============================================
   🎨 TARIFF CARDS
   ============================================ */
.tariff-card {
    border: 2px solid transparent !important;
    background: white !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.tariff-card:hover {
    border-color: #667eea !important;
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2) !important;
}

.tariff-card.selected {
    border-color: #667eea !important;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%) !important;
}

/* ============================================
   🌟 LOADING STATES
   ============================================ */
.spinner-border {
    color: #667eea !important;
}

/* ============================================
   📊 STATS CARDS
   ============================================ */
.stats-card {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%) !important;
    border: 1px solid rgba(102, 126, 234, 0.2) !important;
    border-radius: 15px !important;
    padding: 20px !important;
    transition: all 0.3s ease !important;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.2) !important;
}

/* ============================================
   🔧 UTILITY CLASSES
   ============================================ */
.shadow-sm {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08) !important;
}

.shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* ============================================
   🎯 FOCUS STATES
   ============================================ */
*:focus {
    outline: none !important;
}

*:focus-visible {
    outline: 2px solid #667eea !important;
    outline-offset: 2px !important;
}

/* ============================================
   🌓 DARK MODE SUPPORT
   ============================================ */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a !important;
        color: #f0f0f0 !important;
    }
    
    .sidebar {
        background: rgba(30, 30, 30, 0.95) !important;
    }
    
    .instance-button {
        background: rgba(40, 40, 40, 0.95) !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        color: #f0f0f0 !important;
    }
    
    .card {
        background: rgba(40, 40, 40, 0.95) !important;
        color: #f0f0f0 !important;
    }
    
    .form-control,
    .form-select {
        background: rgba(50, 50, 50, 0.95) !important;
        border-color: rgba(255, 255, 255, 0.2) !important;
        color: #f0f0f0 !important;
    }
}