/* Base styles and variables */
:root {
    --primary: #1a365d;
    --secondary: #2c5282;
    --background: #f7fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #2d3748;
    --success: #28a745;
    --error: #dc3545;
    --warning: #ffc107;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scrollbar-gutter: stable;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header h1 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.header-description {
    color: var(--text);
    opacity: 0.8;
    font-size: 1rem;
}

/* Section */
.section {
    background: var(--surface);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px var(--shadow);
    margin-bottom: 2rem;
    overflow: hidden;
}

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

.section-header h2 {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Grid Layout */
.persons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 1rem;
    padding: 1rem;
}

/* Person Container */
.person-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.person-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--background);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.person-header:hover {
    background-color: var(--border);
}

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

.person-name {
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.score {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--text);
}

/* Toggle icon */
.toggle-icon {
    transition: transform 0.3s ease;
}

.person-container.collapsed .toggle-icon {
    transform: rotate(180deg);
}

/* Prediction Cards */
.person-predictions {
    padding: 1rem;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out, padding 0.3s ease-out;
    max-height: 1500px;
    opacity: 1;
    overflow: hidden;
}

.person-predictions.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0;
}

.prediction-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 1px 2px var(--shadow);
}

.prediction-card:last-child {
    margin-bottom: 0;
}

.unpicked-predictions {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
    gap: 1rem;
}

.unpicked-predictions .prediction-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    box-shadow: 0 1px 2px var(--shadow);
    opacity: 0.8;
}

.unpicked-predictions .prediction-card:hover {
    opacity: 1;
}

.status-indicator {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prediction-content {
    flex-grow: 1;
    min-width: 0;
    overflow-wrap: break-word;
}

.prediction-text {
    margin: 0;
    word-break: break-word;
}

.prediction-notes {
    font-size: 0.875em;
    color: var(--secondary);
    margin-top: 0.5em;
}

.points-badge {
    background-color: var(--background);
    padding: 0.25em 0.5em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-weight: 600;
    margin-left: auto;
    color: var(--text);
}

.prediction-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
    user-select: none;
}

.risky-badge {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.25em 0.5em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.risky-badge i {
    font-size: 0.875em;
}

/* Status Colors */
.text-success { color: var(--success); }
.text-danger { color: var(--error); }
.text-warning { color: var(--warning); }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .persons-grid {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.75rem;
    }
}

.rules-section {
    margin-bottom: 20px;
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
}

.rules-toggle {
    width: 100%;
    text-align: left;
    padding: 12px;
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
    border-radius: 4px;
}

.rules-toggle:hover {
    background: var(--background);
}

.rules-content {
    padding: 16px;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.rules-content p {
    margin-bottom: 1rem;
}

.rules-content p:last-child {
    margin-bottom: 0;
}

.rules-content.hidden {
    display: none;
}
