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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #f5f6f8;
    color: #333;
    line-height: 1.5;
    min-height: 100vh;
}

/* View switching */
.view {
    display: none;
}
.view.active {
    display: block;
}

.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

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

.center-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

/* Typography */
h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.25rem; }
h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 0.75rem; }
h3 { font-size: 1rem; font-weight: 600; }
.subtitle { color: #666; margin-bottom: 2rem; }

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
}

/* App Header */
.app-header {
    margin-bottom: 1.5rem;
}

/* Create Session */
.create-session-card {
    margin-bottom: 2rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: #555;
}
input[type="text"], select, textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9375rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}
input[type="text"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.1);
}
textarea {
    resize: vertical;
    min-height: 60px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    font-family: inherit;
    gap: 0.25rem;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: #4a90d9;
    color: #fff;
}
.btn-secondary {
    background: #e8eaed;
    color: #333;
}
.btn-danger {
    background: #e74c3c;
    color: #fff;
}
.btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.8125rem;
}
.btn-icon {
    padding: 0.3rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}
.btn-icon:hover { opacity: 1; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-owner {
    background: #ffeaa7;
    color: #856404;
}

/* Session List */
.sessions-list {
    margin-top: 1rem;
}
.session-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.session-meta {
    font-size: 0.8125rem;
    color: #888;
}
.session-card-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.empty-state {
    color: #999;
    text-align: center;
    padding: 2rem;
}

/* Join Card */
.join-card {
    width: 100%;
    max-width: 400px;
}
.session-label {
    color: #666;
    margin-bottom: 1rem;
}

/* Hub Header */
.hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: #fff;
    border-bottom: 1px solid #e8eaed;
}
.hub-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.hub-header-left h2 {
    margin-bottom: 0;
}
.hub-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Participant Avatars */
.participant-list {
    display: flex;
    gap: 0.25rem;
}
.participant-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8eaed;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
}
.participant-avatar.me {
    background: #4a90d9;
    color: #fff;
}

/* Hub Tabs */
.hub-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e8eaed;
    padding: 0 1.5rem;
}
.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    color: #888;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    font-family: inherit;
}
.tab-btn:hover { color: #333; }
.tab-btn.active {
    color: #4a90d9;
    border-bottom-color: #4a90d9;
}

#hub-content {
    padding: 1.5rem;
}

/* ===== Retro Board ===== */
.retro-board {
    display: flex;
    gap: 1rem;
    min-height: 60vh;
}
.retro-column {
    flex: 1;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}
.retro-column-header {
    font-weight: 600;
    font-size: 0.9375rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid;
    margin-bottom: 0.75rem;
}
.col-went-well .retro-column-header { color: #27ae60; border-color: #27ae60; }
.col-didnt-go-well .retro-column-header { color: #e74c3c; border-color: #e74c3c; }
.col-action-items .retro-column-header { color: #3498db; border-color: #3498db; }

.retro-add-form {
    margin-bottom: 0.75rem;
}
.retro-add-form textarea {
    min-height: 44px;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.retro-cards {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.retro-card {
    background: #fff;
    border-radius: 6px;
    padding: 0.75rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    position: relative;
}
.retro-card-text {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}
.retro-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #999;
}
.retro-card-author {
    font-style: italic;
}
.retro-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.vote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.vote-btn:hover {
    border-color: #4a90d9;
    color: #4a90d9;
}
.vote-btn.voted {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}
.retro-card .delete-btn {
    opacity: 0;
    transition: opacity 0.2s;
}
.retro-card:hover .delete-btn {
    opacity: 0.5;
}

/* Timer */
.timer-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #fff;
    border-radius: 8px;
    margin-top: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 5rem;
    text-align: center;
}
.timer-display.warning { color: #e67e22; }
.timer-display.danger { color: #e74c3c; }
.timer-presets {
    display: flex;
    gap: 0.25rem;
}

/* ===== Scrum Poker ===== */
.poker-container {
    max-width: 800px;
    margin: 0 auto;
}

.poker-story {
    text-align: center;
    margin-bottom: 1.5rem;
}
.poker-story h3 {
    font-size: 1.125rem;
    color: #333;
}
.poker-story-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
}
.poker-story-form input {
    max-width: 300px;
}

.poker-cards {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}
.poker-card {
    width: 64px;
    height: 90px;
    border: 2px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
    user-select: none;
}
.poker-card:hover {
    border-color: #4a90d9;
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.poker-card.selected {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
    transform: translateY(-8px);
    box-shadow: 0 6px 12px rgba(74,144,217,0.3);
}

.poker-status {
    margin-bottom: 1.5rem;
}
.poker-voters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}
.poker-voter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.poker-voter-card {
    width: 48px;
    height: 68px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9375rem;
}
.poker-voter-card.hidden {
    background: #4a90d9;
    color: #4a90d9;
}
.poker-voter-card.waiting {
    background: #f0f2f5;
    color: #ccc;
    border: 2px dashed #ddd;
}
.poker-voter-card.revealed {
    background: #fff;
    border: 2px solid #4a90d9;
    color: #333;
}
.poker-voter-name {
    font-size: 0.75rem;
    color: #666;
}

.poker-actions {
    text-align: center;
    margin-bottom: 1.5rem;
}

.poker-results {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.poker-results h3 {
    margin-bottom: 1rem;
}
.poker-results-summary {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1rem;
}
.poker-stat {
    text-align: center;
}
.poker-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90d9;
}
.poker-stat-label {
    font-size: 0.75rem;
    color: #888;
}

.poker-results-table {
    width: 100%;
    border-collapse: collapse;
}
.poker-results-table th,
.poker-results-table td {
    padding: 0.5rem 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f2f5;
}
.poker-results-table th {
    font-weight: 600;
    font-size: 0.8125rem;
    color: #888;
    text-transform: uppercase;
}

.poker-estimate-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Poker round history */
.poker-rounds-history {
    margin-top: 2rem;
    border-top: 1px solid #e8eaed;
    padding-top: 1rem;
}
.poker-round-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 1px solid #f0f2f5;
}
.poker-round-estimate {
    font-weight: 600;
    color: #4a90d9;
}

/* ===== History View ===== */
.history-session-header {
    margin: 1.5rem 0 1rem;
}
.history-columns {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}
.history-column {
    flex: 1;
}
.history-card {
    background: #fff;
    border-radius: 6px;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    font-size: 0.875rem;
}
.history-card-votes {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .retro-board {
        flex-direction: column;
    }
    .session-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .hub-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    .history-columns {
        flex-direction: column;
    }
}
