/**
 * Claw Shell Styles
 * Public sidebar layout for The Claw research platform
 * Based on admin.css — teal accent, cw- prefix
 */

/* ============================================
   Layout Structure
   ============================================ */

.cw-layout {
    background: #f7f8f6;
    min-height: 100vh;
}

.cw-wrapper {
    display: flex;
    min-height: 100vh;
}

.cw-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
}

/* ============================================
   Sidebar
   ============================================ */

.cw-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    background: #1a1d29;
    display: flex;
    flex-direction: column;
    z-index: 1040;
    transition: transform 0.3s ease;
}

.cw-sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cw-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #fff;
}

.cw-sidebar-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: #fff;
}

.cw-sidebar-title {
    font-weight: 700;
    font-size: 1.125rem;
}

.cw-sidebar-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.cw-sidebar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

/* Sidebar Navigation */
.cw-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
}

.cw-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cw-nav-item {
    margin: 0 0.75rem;
}

.cw-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.875rem;
}

.cw-nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.cw-nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.cw-nav-link i {
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

/* Child nav links (always visible, indented under parent) */
.cw-nav-children {
    list-style: none;
    padding: 0.125rem 0 0.25rem 0;
    margin: 0;
}

.cw-nav-children .cw-nav-item {
    margin: 0;
}

.cw-nav-child {
    padding: 0.375rem 1rem 0.375rem 2.75rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
}

.cw-nav-child:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.cw-nav-child i {
    font-size: 0.875rem;
    width: 1.25rem;
}

.cw-nav-arrow {
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.cw-nav-item.expanded .cw-nav-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.cw-nav-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.cw-nav-item.expanded .cw-nav-submenu {
    max-height: 500px;
}

.cw-nav-sublink {
    display: block;
    padding: 0.5rem 1rem 0.5rem 3rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    margin: 0.125rem 0;
    transition: all 0.2s ease;
}

.cw-nav-sublink:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.cw-nav-sublink.active {
    color: #fff;
    background: rgba(13, 148, 136, 0.3);
}

/* Sidebar Footer */
.cw-sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ============================================
   Top Bar
   ============================================ */

.cw-topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.cw-sidebar-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    font-size: 1.5rem;
    color: #374151;
    cursor: pointer;
    border-radius: 6px;
}

.cw-sidebar-toggle:hover {
    background: #f3f4f6;
}

.cw-topbar-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: #111827;
}

.cw-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.cw-chip-custom {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    background: rgba(13, 148, 136, 0.1);
    color: #0d9488;
    border: 1px solid rgba(13, 148, 136, 0.25);
    border-radius: 4px;
}

/* ============================================
   Content Area
   ============================================ */

.cw-content {
    flex: 1;
    padding: 1.5rem;
}

/* ============================================
   Cards & Components
   ============================================ */

.cw-welcome-card {
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    color: #fff;
    padding: 2rem;
    border-radius: 12px;
}

.cw-welcome-card h2 {
    margin: 0 0 0.5rem 0;
    font-weight: 700;
}

.cw-welcome-card .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Stat Cards */
.cw-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.cw-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cw-stat-icon.bg-primary-subtle {
    background: rgba(13, 148, 136, 0.1);
    color: #0d9488;
}

.cw-stat-icon.bg-success-subtle {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.cw-stat-icon.bg-info-subtle {
    background: rgba(6, 182, 212, 0.1);
    color: #06b6d4;
}

.cw-stat-icon.bg-warning-subtle {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.cw-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
}

.cw-stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Generic Card */
.cw-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.cw-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.cw-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.cw-card-body {
    padding: 1.25rem;
}

/* ============================================
   Mobile Sidebar Overlay
   ============================================ */

.cw-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 991.98px) {
    .cw-sidebar {
        transform: translateX(-100%);
    }

    .cw-main {
        margin-left: 0;
    }

    body.cw-sidebar-open .cw-sidebar {
        transform: translateX(0);
    }

    body.cw-sidebar-open .cw-sidebar-overlay {
        opacity: 1;
        visibility: visible;
    }
}

/* ============================================
   Tables
   ============================================ */

.cw-table {
    width: 100%;
    border-collapse: collapse;
}

.cw-table th,
.cw-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.cw-table th {
    font-weight: 600;
    color: #374151;
    background: #f9fafb;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.cw-table tbody tr:hover {
    background: #f9fafb;
}

/* ============================================
   Utility Classes
   ============================================ */

.cw-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #6b7280;
}

.cw-empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
