/* Base CSS for MarketAlgoBot */
@import url('../logo/logo-colors.css');

:root {
    /* Brand Colors */
    --primary-color: var(--mab-primary);
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    
    /* Light Theme */
    --text-color: #333;
    --text-muted: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #dee2e6;
    --nav-bg: var(--secondary-color);
    --nav-text: #ffffff;
    --nav-hover: rgba(255,255,255,0.1);
    --primary-hover: #e6b800;
    
    /* Logo Animation */
    --logo-size: 100px;
    --logo-animation-duration: 2s;
}

/* Dark Theme */
[data-theme="dark"] {
    --text-color: #ffffff;
    --text-muted: #adb5bd;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --nav-bg: #000000;
    --nav-text: #ffffff;
    --nav-hover: rgba(255,255,255,0.1);
    --primary-hover: #e6b800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navbar */
.navbar {
    background-color: var(--nav-bg);
    padding: 0.075rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo {
    width: calc(var(--logo-size) * 0.75);
    height: calc(var(--logo-size) * 0.75);
    animation: logoFloat 3s ease-in-out infinite;
}

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

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-user {
    color: var(--nav-text);
    font-size: 0.9rem;
}

.nav-link {
    color: var(--nav-text);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-link:hover {
    background-color: var(--nav-hover);
}

/* Theme Switcher */
.theme-switcher {
    background: rgba(249, 201, 36, 0.1);
    border: 1px solid rgba(249, 201, 36, 0.2);
    color: var(--nav-text);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.theme-switcher:hover {
    background: rgba(249, 201, 36, 0.2);
    border-color: rgba(249, 201, 36, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.theme-switcher:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* PWA Install Button */
.pwa-install-btn {
    background: linear-gradient(45deg, var(--primary-color), #ff6b35);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

.pwa-install-btn:hover {
    background: linear-gradient(45deg, #ff6b35, var(--primary-color));
    transform: scale(1.05);
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(249, 201, 36, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(249, 201, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 201, 36, 0); }
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 100px;
    right: 20px;
    z-index: 1001;
    max-width: 400px;
    pointer-events: none;
}

.flash-message {
    padding: 0;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    overflow: hidden;
}

.flash-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
}

.flash-text {
    flex: 1;
    margin-right: 1rem;
}

.flash-close {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.flash-close:hover {
    opacity: 1;
    background-color: rgba(0,0,0,0.1);
}

.flash-message.show {
    transform: translateX(0);
    opacity: 1;
}

.flash-message.hide {
    transform: translateX(100%);
    opacity: 0;
}

[data-theme="dark"] .flash-message {
    background: rgba(45, 45, 45, 0.95);
    border-color: var(--border-color);
}

[data-theme="dark"] .flash-close:hover {
    background-color: rgba(255,255,255,0.1);
}

/* Dark mode flash message colors */
[data-theme="dark"] .flash-success {
    background: rgba(40, 167, 69, 0.15);
    border-color: #28a745;
    color: #a8f5b4;
}

[data-theme="dark"] .flash-error {
    background: rgba(220, 53, 69, 0.25);
    border-color: #dc3545;
    color: #ffb3b3;
    border-width: 2px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

[data-theme="dark"] .flash-warning {
    background: rgba(255, 193, 7, 0.15);
    border-color: #ffc107;
    color: #fff3cd;
}

.flash-success {
    background-color: #d4edda;
    border-color: var(--success-color);
    color: #155724;
}

.flash-error {
    background-color: #f8d7da;
    border-color: var(--error-color);
    color: #721c24;
    border-width: 2px;
    font-weight: 600;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.15);
}

.flash-warning {
    background-color: #fff3cd;
    border-color: var(--warning-color);
    color: #856404;
    border-width: 2px;
    font-weight: 600;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: calc(100vh - 200px);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: #e6b800;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover {
    background-color: #1a252f;
}

.btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.btn-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
}

/* Mobile Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
    transition: all 0.3s ease;
    position: relative;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.mobile-menu-toggle:hover .hamburger-line {
    background-color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(249, 201, 36, 0.3);
}

/* Ensure hamburger is visible in light mode */
[data-theme="light"] .hamburger-line {
    background-color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

[data-theme="light"] .mobile-menu-toggle:hover .hamburger-line {
    background-color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(249, 201, 36, 0.4);
}

/* Ensure hamburger is visible in dark mode */
[data-theme="dark"] .hamburger-line {
    background-color: #fff;
    box-shadow: 0 1px 2px rgba(255,255,255,0.2);
}

[data-theme="dark"] .mobile-menu-toggle:hover .hamburger-line {
    background-color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(249, 201, 36, 0.4);
}

/* Default light theme hamburger */
.hamburger-line {
    background-color: #333;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Hamburger animation */
.mobile-menu-toggle:active .hamburger-line {
    transform: scale(0.95);
}

/* Ensure proper spacing between hamburger lines */
.mobile-menu-toggle {
    gap: 2px;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    /* Navbar mobile optimization */
    .navbar {
        padding: 0.75rem 1rem;
        position: sticky;
        top: 0;
        background: var(--bg-color);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .nav-container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .nav-brand {
        font-size: 1.2rem;
        flex-shrink: 0;
        font-weight: 600;
        color: var(--text-color);
    }
    
    .nav-brand a {
        color: var(--text-color);
        text-decoration: none;
        font-weight: 600;
    }
    
    .nav-logo {
        width: 40px;
        height: 40px;
    }
    
    /* Show hamburger menu */
    .mobile-menu-toggle {
        display: flex;
        margin-left: auto;
    }
    
    /* Hide nav menu by default on mobile */
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-color);
        border: 1px solid var(--border-color);
        border-top: none;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
    
    .nav-menu.active {
        max-height: 70vh;
        padding: 1rem;
        gap: 0.5rem;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    

    
    .nav-link {
        padding: 1rem;
        border-radius: 8px;
        text-align: center;
        font-size: 0.95rem;
        background: transparent;
        transition: all 0.2s ease;
        border: none;
        width: 100%;
        display: block;
        color: var(--text-color);
        font-weight: 500;
        text-decoration: none;
    }
    
    .nav-link:hover {
        background: rgba(249, 201, 36, 0.15);
        transform: translateX(5px);
        color: var(--primary-color);
    }
    
    .nav-user {
        font-size: 0.9rem;
        padding: 1rem;
        background: rgba(249, 201, 36, 0.15);
        border-radius: 8px;
        text-align: center;
        margin-bottom: 0.5rem;
        border: 1px solid rgba(249, 201, 36, 0.3);
        color: var(--text-color);
        font-weight: 600;
    }
    
    .pwa-install-btn {
        font-size: 0.85rem;
        padding: 1rem;
        margin: 0.25rem 0;
        background: linear-gradient(135deg, var(--primary-color), #e6b800);
        color: #000;
        font-weight: 600;
        border: none;
        border-radius: 8px;
        transition: all 0.2s ease;
    }
    
    .pwa-install-btn:hover {
        background: linear-gradient(135deg, #e6b800, var(--primary-color));
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(249, 201, 36, 0.3);
    }
    
    .theme-switcher {
        padding: 1rem;
        font-size: 1.1rem;
        background: rgba(249, 201, 36, 0.15);
        border: 1px solid rgba(249, 201, 36, 0.3);
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
        width: 100%;
        text-align: center;
        color: var(--text-color);
        font-weight: 600;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .theme-switcher:hover {
        background: rgba(249, 201, 36, 0.25);
        border-color: rgba(249, 201, 36, 0.5);
        color: var(--primary-color);
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }
    
    .theme-switcher:active {
        transform: translateY(0);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Flash messages mobile */
    .flash-messages {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .flash-message {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Main content mobile */
    .main-content {
        padding: 1rem 0.5rem;
        min-height: calc(100vh - 150px);
    }
    
    /* Buttons mobile */
    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.95rem;
    }
    
    /* Touch-friendly improvements */
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        transform: scale(0.98);
    }
    
    /* Better spacing for mobile */
    body {
        font-size: 16px;
        line-height: 1.5;
    }
    
    /* Improve form inputs on mobile */
    input, textarea, select {
        font-size: 16px !important;
        -webkit-appearance: none;
        border-radius: 8px;
    }
    
    /* Better focus states for mobile */
    input:focus, textarea:focus, select:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(249, 201, 36, 0.2);
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.5rem 0.75rem;
        position: sticky;
        top: 0;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .nav-logo {
        width: 35px;
        height: 35px;
    }
    
    .nav-brand {
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .mobile-menu-toggle {
        width: 30px;
        height: 30px;
    }
    
    .hamburger-line {
        height: 3px;
    }
    
    .nav-menu.active {
        padding: 0.75rem;
    }
    
    .nav-link {
        padding: 0.875rem;
        font-size: 0.9rem;
        font-weight: 600;
    }
    
    .nav-user {
        padding: 0.875rem;
        font-size: 0.85rem;
        font-weight: 700;
    }
    
    .flash-messages {
        top: 50px;
        right: 5px;
        left: 5px;
    }
    
    .flash-message {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .main-content {
        padding: 0.75rem 0.25rem;
    }
}

/* Confirmation Dialog Styles */
.confirmation-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.confirmation-dialog.show {
    display: flex;
}

.confirmation-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.confirmation-modal {
    position: relative;
    background: var(--card-bg);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    border: 1px solid var(--border-color);
}

.confirmation-header {
    background: linear-gradient(135deg, var(--primary-color), #e67e22);
    color: white;
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.confirmation-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    animation: pulse 2s infinite;
}

.confirmation-title {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.confirmation-body {
    padding: 1.5rem;
    text-align: center;
}

.confirmation-body p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
}

.confirmation-actions {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirmation-actions .btn {
    min-width: 100px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.confirmation-actions .btn-secondary {
    background: var(--border-color);
    color: var(--text-color);
}

.confirmation-actions .btn-secondary:hover {
    background: #bdc3c7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.confirmation-actions .btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.confirmation-actions .btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

.confirmation-actions .btn-warning {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.confirmation-actions .btn-warning:hover {
    background: linear-gradient(135deg, #e67e22, #d35400);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.confirmation-actions .btn-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.confirmation-actions .btn-info:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Dialog Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

/* Dark theme adjustments */
[data-theme="dark"] .confirmation-modal {
    background: var(--card-bg);
    border-color: var(--border-color);
}

[data-theme="dark"] .confirmation-actions .btn-secondary {
    background: #404040;
    color: #ffffff;
}

[data-theme="dark"] .confirmation-actions .btn-secondary:hover {
    background: #505050;
}

/* Mobile responsiveness for confirmation dialog */
@media (max-width: 480px) {
    .confirmation-modal {
        width: 95%;
        margin: 1rem;
    }
    
    .confirmation-header {
        padding: 1rem;
    }
    
    .confirmation-icon {
        font-size: 2.5rem;
    }
    
    .confirmation-title {
        font-size: 1.2rem;
    }
    
    .confirmation-body {
        padding: 1rem;
    }
    
    .confirmation-body p {
        font-size: 1rem;
    }
    
    .confirmation-actions {
        padding: 1rem;
        flex-direction: column;
    }
    
    .confirmation-actions .btn {
        width: 100%;
        min-width: auto;
    }
}
