/* Modern Features CSS for EarnWatch Platform */

/* CSS Variables for Theme Support */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #667eea;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --error-color: #dc3545;
    --info-color: #17a2b8;
    
    /* Dark theme (default) */
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    --border-color: #444444;
    --card-bg: rgba(255, 255, 255, 0.1);
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Light theme */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border-color: #dee2e6;
    --card-bg: rgba(255, 255, 255, 0.9);
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    margin-left: 10px;
}

.theme-toggle-btn:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 5px 15px var(--shadow-color);
}

/* PWA Install Banner */
.install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px var(--shadow-color);
    z-index: 1000;
    animation: slideInUp 0.3s ease;
}

.install-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.install-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.install-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Toast Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.toast {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 10px;
    transform: translateX(400px);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px var(--shadow-color);
    pointer-events: auto;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 10px;
}

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.toast-close:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Toast Types */
.toast-success {
    border-color: var(--success-color);
}

.toast-error {
    border-color: var(--error-color);
}

.toast-warning {
    border-color: var(--warning-color);
}

.toast-info {
    border-color: var(--info-color);
}

/* Keyboard Shortcuts Help */
.shortcuts-help-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 999;
}

.shortcuts-help-btn:hover {
    border-color: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 5px 15px var(--shadow-color);
}

.shortcuts-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.shortcuts-modal-content {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(20px);
    color: var(--text-primary);
}

.shortcuts-modal-content h3 {
    margin-bottom: 20px;
    color: var(--primary-color);
    text-align: center;
}

.shortcuts-list {
    margin-bottom: 20px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.shortcut-item:last-child {
    border-bottom: none;
}

kbd {
    background: var(--border-color);
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 5px;
    font-family: monospace;
    font-size: 0.9rem;
    border: 1px solid var(--text-muted);
}

/* Loading Skeletons */
.skeleton-card {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.skeleton-line {
    height: 20px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.skeleton-line.short {
    width: 60%;
}

.skeleton-line.medium {
    width: 80%;
}

.skeleton-line.long {
    width: 100%;
}

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animate-in {
    opacity: 1;
    transform: translateY(0);
}

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

/* Enhanced Focus States */
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

/* Offline Indicator */
body.offline::before {
    content: "You are offline";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--warning-color);
    color: #000;
    text-align: center;
    padding: 10px;
    z-index: 10002;
    font-weight: bold;
}

/* Improved Card Hover Effects */
.dashboard-card,
.article-card,
.game-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dashboard-card:hover,
.article-card:hover,
.game-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px var(--shadow-color);
}

/* Modern Button Animations */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

/* Glass Morphism Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Responsive Modern Grid */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

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

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

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

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

/* Animations */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

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

/* Mobile Optimizations */
@media (max-width: 768px) {
    .theme-toggle-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .shortcuts-help-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
        bottom: 15px;
        right: 15px;
    }
    
    .install-banner {
        left: 10px;
        right: 10px;
        bottom: 10px;
    }
    
    .notification-container {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    
    .toast {
        max-width: none;
    }
}