:root {
    --bg-sidebar: #f9fafb;
    --bg-main: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
    
    --accent-blue: #3b82f6;
    --accent-red: #ef4444;
    --accent-gold: #f59e0b;
    
    --card-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-main);
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.nav-menu {
    flex-grow: 1;
}

.menu-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.filter-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.filter-btn.active {
    background-color: #fff;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
    font-weight: 600;
}

.filter-btn i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
    }
    
    .app-container {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
    
    .filter-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 120px;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .top-bar h1 {
        font-size: 1.3rem;
    }
    
    .search-box {
        width: 100%;
        max-width: 300px;
    }
    
    .roles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .mini-card {
        padding: 1rem;
    }
    
    .mini-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 0.75rem;
    }
    
    .filter-btn {
        min-width: 100px;
        font-size: 0.75rem;
        padding: 0.6rem 0.5rem;
    }
    
    .filter-btn i {
        display: none;
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .roles-grid {
        gap: 0.75rem;
    }
    
    .mini-card {
        padding: 0.75rem;
    }
    
    .top-bar h1 {
        font-size: 1.2rem;
    }
    
    .mini-card {
        font-size: 0.9rem;
    }
    
    .role-type-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .filter-btn:hover {
        background-color: transparent;
        color: var(--text-secondary);
    }
    
    .filter-btn.active {
        background-color: #fff;
        color: var(--text-primary);
    }
    
    .mini-card:hover {
        transform: none;
        box-shadow: var(--card-shadow);
    }
    
    .mini-card:active {
        transform: scale(0.98);
        box-shadow: var(--hover-shadow);
    }
}

/* Main Content */
.main-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 2rem 3rem;
    background-color: var(--bg-main);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.top-bar h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.search-box {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    width: 250px;
}

/* Grid */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding-bottom: 2rem;
}

/* Cards */
.mini-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mini-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hover-shadow);
    border-color: #d1d5db;
}

.mini-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.role-type-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
}

.mini-card[data-type="good"] .role-type-badge { color: var(--accent-blue); background: #eff6ff; }
.mini-card[data-type="traitor"] .role-type-badge { color: var(--accent-red); background: #fef2f2; }
.mini-card[data-type="neutral"] .role-type-badge { color: var(--accent-gold); background: #fffbeb; }

.difficulty-indicator {
    display: flex;
    gap: 3px;
}

.diff-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #e5e7eb;
}

.diff-dot.filled {
    background-color: var(--text-secondary);
}

.mini-card h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.mini-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 550px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1);
    transition: transform 0.2s ease;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal.hidden .modal-content {
    transform: scale(0.98);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.close-modal {
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-modal:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

/* File Card (Modal Inner) */
.file-header {
    margin-bottom: 1.5rem;
}

.file-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.file-type {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 2px 8px;
    background: var(--hover-bg);
    border-radius: 4px;
}

.file-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.skill-text {
    background: var(--bg-sidebar);
    padding: 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
    }

    .nav-menu {
        display: none; /* Simplify mobile for now, or make collapsible */
    }
    
    .main-content {
        padding: 1.5rem;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .search-box {
        width: 100%;
    }
}
