html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

/* Modern color palette */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --danger-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    --info-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --shadow-xl: 0 12px 40px rgba(0,0,0,0.2);
}

/* Glass morphism effect */
.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);
}

/* Animated gradient background */
body {
    background: linear-gradient(-45deg, #f5f7fa, #e8eef5, #f0f4f8, #e3e9f1);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Card hover effects */
.log-item,
.scope-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.log-item::before,
.scope-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.log-item:hover::before,
.scope-card:hover::before {
    left: 100%;
}

.log-item:hover,
.scope-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Gradient badges */
.log-scope-badge {
    background: var(--primary-gradient);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s;
}

.log-scope-badge:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.log-type-error .log-type-badge {
    background: var(--danger-gradient);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

.log-type-warning .log-type-badge {
    background: var(--warning-gradient);
    box-shadow: 0 4px 12px rgba(250, 112, 154, 0.3);
}

.log-type-info .log-type-badge {
    background: var(--info-gradient);
    box-shadow: 0 4px 12px rgba(67, 233, 123, 0.3);
}

/* Pulsing effect on error badges */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    }
}

.log-type-error .log-type-badge {
    animation: pulse 2s ease-in-out infinite;
}

/* Button improvements */
.btn-primary {
    background: var(--primary-gradient);
    border: none;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
    transition: all 0.3s;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Floating animation for install button */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

#install-button-desktop,
#install-button-mobile {
    animation: float 3s ease-in-out infinite;
}

/* Bottom nav improvements */
.bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.bottom-nav a,
.bottom-nav button {
    position: relative;
    overflow: hidden;
}

.bottom-nav a::after,
.bottom-nav button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--primary-gradient);
    transition: all 0.3s;
    transform: translateX(-50%);
}

.bottom-nav a.active::after,
.bottom-nav a:hover::after,
.bottom-nav button:hover::after {
    width: 60%;
}

.bottom-nav a.active .nav-icon,
.bottom-nav button.active .nav-icon {
    transform: scale(1.1);
}

/* Smooth icon transitions */
.nav-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-icon:hover {
    transform: scale(1.15) rotate(5deg);
}

/* Loading spinner improvements */
.spinner {
    border-width: 3px;
    animation: spin 0.8s linear infinite, pulse-spinner 2s ease-in-out infinite;
}

@keyframes pulse-spinner {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Toast improvements */
.toast-notification {
    background: var(--success-gradient);
    backdrop-filter: blur(10px);
}

/* Details/Summary improvements */
details summary {
    transition: all 0.3s;
    cursor: pointer;
    user-select: none;
}

details summary:hover {
    transform: translateX(5px);
}

details[open] summary {
    margin-bottom: 0.75rem;
}

/* Scope key copy improvements */
.scope-key-copy {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 2px solid rgba(102, 126, 234, 0.2);
    transition: all 0.3s;
}

.scope-key-copy:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-color: rgba(102, 126, 234, 0.4);
    transform: scale(1.02);
}

/* Empty state improvements */
.empty-state {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 4rem 2rem;
    backdrop-filter: blur(10px);
}

/* Error state improvements */
.error-state {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    backdrop-filter: blur(10px);
}

.error-icon {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Offline banner improvements */
.offline-banner {
    background: linear-gradient(135deg, #ff9800, #ff6b00);
    animation: slideDown 0.3s ease, pulse-banner 2s ease-in-out infinite;
}

@keyframes pulse-banner {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
}

/* Pull indicator improvements */
.ptr-spinner {
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.3));
}

/* Form improvements */
.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Stagger animation for lists */
.log-list .log-item,
.scopes-grid .scope-card {
    animation: fadeInUp 0.5s ease-out backwards;
}

.log-list .log-item:nth-child(1),
.scopes-grid .scope-card:nth-child(1) { animation-delay: 0.1s; }
.log-list .log-item:nth-child(2),
.scopes-grid .scope-card:nth-child(2) { animation-delay: 0.2s; }
.log-list .log-item:nth-child(3),
.scopes-grid .scope-card:nth-child(3) { animation-delay: 0.3s; }
.log-list .log-item:nth-child(4),
.scopes-grid .scope-card:nth-child(4) { animation-delay: 0.4s; }
.log-list .log-item:nth-child(5),
.scopes-grid .scope-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}

/* Selection styling */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: inherit;
}

::-moz-selection {
    background: rgba(102, 126, 234, 0.3);
    color: inherit;
}