/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Premium Dark Gym Theme */
    --bg-main: #0a0a0c;
    --bg-card: #141418;
    --bg-input: #1f1f25;
    
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-primary: #ef4444; /* Red accent for Krav Maga */
    --accent-primary-hover: #dc2626; 
    --accent-secondary: #f59e0b; /* Orange/Yellow secondary */
    --accent-success: #10b981; 
    --accent-warning: #f59e0b; 
    --accent-danger: #ef4444; 
    
    --border-color: #27272a;
    
    --font-family: 'Outfit', sans-serif;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 15px rgba(239, 68, 68, 0.4);
    
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--accent-primary-hover); }

/* Layout & Containers */
.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: width var(--transition-normal);
    z-index: 1000;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: visible; /* Changed from overflow-x: hidden to allow floating button */
    flex-shrink: 0;
}

.sidebar.collapsed {
    width: 65px;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.sidebar-search-btn {
    margin: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-search-btn span {
    transition: opacity var(--transition-normal);
}

.sidebar.collapsed .sidebar-search-btn span {
    opacity: 0;
    pointer-events: none;
}

.sidebar-logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding-left: 0.5rem;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-logo span {
    transition: opacity var(--transition-normal);
}

@media (min-width: 993px) {
    .sidebar.collapsed {
        width: 65px;
    }
    
    .sidebar.collapsed .sidebar-search-btn span,
    .sidebar.collapsed .sidebar-logo span,
    .sidebar.collapsed .menu-item span {
        opacity: 0;
        pointer-events: none;
    }
    
    .sidebar.collapsed .sidebar-logo span {
        display: none;
    }
    
    .sidebar.collapsed .sidebar-toggle {
        transform: rotate(180deg);
    }
}

.sidebar-menu {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}
.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sidebar.collapsed .sidebar-menu {
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.sidebar.collapsed .sidebar-menu::-webkit-scrollbar {
    display: none;
}

.menu-item {
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-weight: 500;
    white-space: nowrap;
}

.menu-item i { 
    font-size: 1.25rem; 
    min-width: 25px; 
    text-align: center; 
}

.menu-item span {
    transition: opacity var(--transition-normal);
}

.menu-item:hover, .menu-item.active {
    background-color: rgba(200, 200, 255, 0.05);
    color: var(--accent-primary);
    border-right: 3px solid var(--accent-primary);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: absolute;
    right: -16px;
    top: 32px;
    width: 32px;
    height: 32px;
    background-color: var(--accent-primary);
    border: 4px solid var(--bg-main);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.sidebar-toggle:hover {
    background-color: var(--accent-primary-hover);
    transform: scale(1.1);
}

.sidebar.collapsed .sidebar-toggle {
    transform: rotate(180deg);
}

.sidebar.collapsed .sidebar-toggle:hover {
    transform: rotate(180deg) scale(1.1);
}

.main-content {
    flex: 1;
    margin-left: 0;
    padding: 2rem 3rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all var(--transition-normal);
}

.mobile-header {
    display: none;
}

.mobile-close {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }

/* Cards & Components */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(255, 75, 75, 0.2);
}

.btn-primary:hover {
    background-color: var(--accent-primary-hover);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-success { background-color: var(--accent-success); color: white; }
.btn-success:hover { filter: brightness(1.1); }

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--text-secondary); background-color: var(--bg-input); }

/* Forms & Inputs */
.form-group { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    transition: all var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(255, 75, 75, 0.15);
}

/* Tables */
.table-responsive { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border-color); }

.table { width: 100%; border-collapse: collapse; text-align: left; }

.table th, .table td { padding: 1rem; border-bottom: 1px solid var(--border-color); }

.table th {
    background-color: var(--bg-card);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.table tbody tr { background-color: var(--bg-main); transition: background-color var(--transition-fast); }

.table tbody tr:hover { background-color: var(--bg-card); }

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success { background-color: rgba(16, 185, 129, 0.1); color: var(--accent-success); }
.badge-warning { background-color: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.badge-danger { background-color: rgba(255, 75, 75, 0.1); color: var(--accent-primary); }

/* Login/Auth Layout */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, #1a1a24 0%, var(--bg-main) 100%);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background-color: rgba(20, 20, 24, 0.8);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.auth-header { text-align: center; margin-bottom: 2.5rem; }
.auth-logo { font-size: 2rem; font-weight: 800; color: var(--accent-primary); margin-bottom: 0.5rem; letter-spacing: 1px;}
.auth-subtitle { color: var(--text-secondary); font-size: 0.875rem; }

/* Dashboard Grid */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(255, 75, 75, 0.1);
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-info h3 { font-size: 1.75rem; margin-bottom: 0.25rem; }
.stat-info p { margin: 0; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.5px; }

/* Responsive Media Queries */
@media (max-width: 992px) {
    .sidebar { 
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        transform: translateX(-100%); 
        width: 280px; 
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0,0,0,0.5);
    }
    .sidebar.open { transform: translateX(0); }
    
    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s ease;
        z-index: 999;
    }
    .sidebar-backdrop.active { opacity: 1; visibility: visible; }

    .main-content { margin-left: 0; padding: 1.5rem; width: 100%; }
    
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem;
        background-color: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        margin: -1.5rem -1.5rem 2rem -1.5rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    
    .menu-toggle {
        background: rgba(255, 255, 255, 0.05); 
        border: 1px solid var(--border-color);
        color: var(--text-primary); 
        font-size: 1.25rem; 
        cursor: pointer;
        width: 45px;
        height: 45px;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-close {
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.05);
        border: none;
        color: var(--text-primary);
        font-size: 1.25rem;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
    }

    /* Sidebar hover effects disabled on mobile */
    .sidebar:hover { width: 280px; }
    .sidebar .menu-item span, .sidebar .sidebar-logo span, .sidebar .sidebar-search-btn span { opacity: 1; }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    
    .grid-cards { grid-template-columns: 1fr; }
    
    .card { padding: 1.25rem; }
    
    .btn { width: 100%; padding: 0.85rem; }

    .table th, .table td { padding: 0.75rem 0.5rem; font-size: 0.85rem; }
}

/* Knowledge Center Styles */
.info-center-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.info-card:hover {
    border-color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-5px);
}

.info-card h4 {
    color: var(--accent-secondary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
}

.info-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    border-left: 3px solid rgba(255,255,255,0.1);
    padding-left: 1rem;
}

.faq-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: auto;
}

.faq-question {
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faq-answer {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 1rem;
}

.copy-btn {
    width: 100%;
    padding: 0.6rem;
    font-size: 0.75rem;
    border: 1px solid var(--accent-secondary);
    color: var(--accent-secondary);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-weight: 600;
}

.copy-btn:hover {
    background: var(--accent-secondary);
    color: white;
}

/* Knowledge Center Media Styles */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.info-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-lg);
}
