﻿:root {
    --primary: #2D3E50;
    --primary-light: #3A5167;
    --accent: #FF6B6B;
    --accent-soft: #FFE5E5;
    --success: #10B981;
    --success-soft: #D1FAE5;
    --surface: #FAFBFC;
    --surface-elevated: #FFFFFF;
    --text-primary: #1A1F25;
    --text-secondary: #5F6C7B;
    --text-tertiary: #94A3B8;
    --border: #E5E9F0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #F8FAFC 0%, #EFF1F5 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Wrapper Layout */
.landing-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.landing-sidebar {
    width: 300px;
    background: var(--surface-elevated);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease-in-out, left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

/* Desktop: Hide sidebar by sliding to the left */
@media (min-width: 993px) {
    .landing-sidebar.sidebar-hidden {
        left: -300px;
    }
}

.sidebar-content {
    padding: 0.8rem 1.5rem;
}

/* Sidebar Modules */
.sidebar-modules {
    margin-bottom: 1rem;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    position: relative;
    width: 100%;
}

.sidebar-item:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(45, 62, 80, 0.2);
}

.sidebar-item i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

.sidebar-item span:not(.pool-count) {
    flex: 1;
}

.sidebar-item.pool-badge {
    position: relative;
}

.sidebar-item .pool-count {
    position: relative;
    top: auto;
    right: auto;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 2px solid var(--surface-elevated);
    margin-left: 0.5rem;
}

.sidebar-item.active .pool-count {
    border-color: var(--primary-light);
}

/* Categories */
.category-sidebar-header {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.category-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.category-item:hover {
    background: var(--surface);
}

.category-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(45, 62, 80, 0.2);
}

.category-item i {
    margin-right: 0.5rem;
}

/* Main Content Area */
.landing-main {
    flex: 1;
    margin-left: 300px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease-in-out;
}

/* Desktop: Expand main content when sidebar is hidden */
@media (min-width: 993px) {
    .landing-main.main-expanded {
        margin-left: 0;
    }
}

/* Header */
.navbar-custom {
    background: var(--surface-elevated);
    height: 72px;
/*    padding: 0 2rem;
*/    box-shadow: none;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-sidebar .navbar-brand {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    padding: 16px 25px;
}

.navbar-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
}

/* Hamburger Menu - Always Visible */
.sidebar-toggle-landing {
    display: block;
    margin-right: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
    text-decoration: none;
}

.sidebar-toggle-landing:hover {
    background: var(--surface);
}

.hamburger-landing {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    position: relative;
}

.hamburger-landing span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.sidebar-toggle-landing.active .hamburger-landing span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.sidebar-toggle-landing.active .hamburger-landing span:nth-child(2) {
    opacity: 0;
}

.sidebar-toggle-landing.active .hamburger-landing span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Sidebar Overlay - Hidden, not used anymore */
.sidebar-overlay {
    display: none !important;
}

/* Content Area */
.landing-content {
    flex: 1;
    padding: 0;
    background: var(--surface);
}

/* Footer */
.landing-footer {
    background: var(--surface-elevated);
    border-top: 1px solid var(--border);
    padding: 0.9rem 2rem;
    margin-top: auto;
}

.landing-footer .text-muted {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.landing-footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.landing-footer a:hover {
    color: var(--primary);
}

/* Sidebar Scrollbar */
.landing-sidebar::-webkit-scrollbar {
    width: 6px;
}

.landing-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.landing-sidebar::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 10px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .landing-sidebar {
        transform: translateX(-100%);
        left: 0 !important; /* Override desktop hidden state on mobile */
        transition: transform 0.3s ease-in-out;
        z-index: 1001; /* Higher z-index to appear above content */
    }

    .landing-sidebar.sidebar-open {
        transform: translateX(0);
    }

    .landing-main {
        margin-left: 0;
        transition: none; /* No transition on mobile for main content */
    }
    
    /* Ensure sidebar is not hidden on mobile */
    .landing-sidebar.sidebar-hidden {
        left: 0 !important;
        transform: translateX(-100%);
    }
    
    /* Prevent body scroll when sidebar is open on mobile */
    body.sidebar-open-mobile {
        overflow: hidden;
    }
}

@media (max-width: 768px) {
    .navbar-custom {
        padding: 0 1rem;
        height: 64px;
    }

    .navbar-custom .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-logo-icon {
        width: 28px;
        height: 28px;
        font-size: 1rem;
    }

    .landing-footer {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .navbar-custom {
        padding: 0 0.75rem;
        height: 60px;
    }

    .navbar-custom .navbar-brand {
        font-size: 1.1rem;
    }

    .navbar-custom .navbar-brand span {
        display: none;
    }

    .navbar-logo-icon {
        width: 26px;
        height: 26px;
    }

    .landing-footer {
        padding: 0.75rem;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* Loading Animation */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 85, 104, 0.3);
    border-radius: 50%;
    border-top-color: #4a5568;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Custom Notification System */
.notification-container {
    position: fixed;
    top: 90px;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.notification {
    background: var(--surface-elevated);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 20px rgba(45, 62, 80, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
    position: relative;
    overflow: hidden;
}

.notification::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    width: 100%;
}

.notification:not(.loading)::after {
    animation: notificationProgress var(--duration, 3000ms) linear;
}

.notification.success {
    border-left-color: var(--success);
    color: var(--text-primary);
}

.notification.success .notification-icon {
    color: var(--success);
}

.notification.error {
    border-left-color: var(--accent);
    color: var(--text-primary);
}

.notification.error .notification-icon {
    color: var(--accent);
}

.notification.warning {
    border-left-color: #F59E0B;
    color: var(--text-primary);
}

.notification.warning .notification-icon {
    color: #F59E0B;
}

.notification.info {
    border-left-color: var(--primary);
    color: var(--text-primary);
}

.notification.info .notification-icon {
    color: var(--primary);
}

.notification.loading {
    border-left-color: var(--primary);
    color: var(--text-primary);
}

.notification.loading .notification-icon {
    color: var(--primary);
}

.notification-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.notification-message {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.notification-close:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.notification.loading .notification-close {
    display: none;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes notificationProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

.notification.slide-out {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Confirmation Dialog */
.confirmation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.confirmation-dialog {
    background: var(--surface-elevated);
    border-radius: 16px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(45, 62, 80, 0.2);
    animation: scaleIn 0.2s ease-out;
}

.confirmation-dialog-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
}

.confirmation-dialog-icon.warning {
    background: #FEF3C7;
    color: #F59E0B;
}

.confirmation-dialog-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.75rem;
}

.confirmation-dialog-message {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.confirmation-dialog-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirmation-dialog-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.confirmation-dialog-btn.cancel {
    background: var(--surface);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.confirmation-dialog-btn.cancel:hover {
    background: var(--border);
    color: var(--text-primary);
}

.confirmation-dialog-btn.confirm {
    background: var(--accent);
    color: white;
}

.confirmation-dialog-btn.confirm:hover {
    background: #e03e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
