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

:root {
    --bg-primary: #0f0f1e;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #e4e4e7;
    --text-secondary: #a1a1aa;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #27272a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 1rem 2rem;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 1.5rem;
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-time {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.refresh-btn {
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: transform 0.3s;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.refresh-btn:hover {
    background: var(--bg-secondary);
}

.refresh-btn:active {
    transform: rotate(180deg);
}

/* Dashboard Grid Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.grid-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Karty */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Karty z różnymi wysokościami */
.weather-card,
.astro-weather-card {
    min-height: 250px;
}

.stats-card {
    min-height: 200px;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Weather */
.weather-icon {
    text-align: center;
    margin: 0.5rem 0;
}

.weather-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.weather-item {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.weather-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.weather-item .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Astro Weather */
.astro-quality {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    margin-top: 0.5rem;
}

.astro-quality.excellent {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.astro-quality.good {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent);
}

.astro-quality.medium {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.astro-quality.poor {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* NBA Table */
.nba-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
}

.nba-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.nba-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}

.nba-table th {
    padding: 0.6rem 0.4rem;
    text-align: left;
    font-weight: 600;
    color: #ffffff;
    font-size: 0.75rem;
}

.nba-table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid var(--border);
    color: #ffffff;
}

.nba-table tr:last-child td {
    border-bottom: none;
}

.nba-table tbody tr {
    transition: background 0.2s;
}

.nba-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.1);
}

.nba-table tbody tr.game-finished {
    opacity: 0.95;
}

.game-date {
    color: #d1d5db;
    font-size: 0.7rem;
    white-space: nowrap;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #ffffff;
}

.team-cell.winner {
    font-weight: bold;
    color: #60a5fa;
}

.team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.score-cell {
    text-align: center;
    font-weight: bold;
    font-size: 0.95rem;
    color: #ffffff;
}

.score-cell .winner-score {
    color: #60a5fa;
    font-weight: 900;
}

.status-cell {
    display: none;
}

.status-badge {
    display: none;
}

/* Emails */
.filter-select {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

.email-item {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--accent);
    transition: all 0.2s;
}

.email-item:hover {
    background: rgba(59, 130, 246, 0.05);
    transform: translateX(4px);
}

.email-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.4rem;
}

.email-sender {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.email-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.email-subject {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.email-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.play-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-top: 0.5rem;
    transition: background 0.3s;
}

.play-btn:hover {
    background: var(--accent-hover);
}

.play-btn:active {
    transform: scale(0.95);
}

/* Email categories */
.email-item[data-category="REKLAMA"],
.email-item[data-category="SPAM"] {
    border-left-color: var(--warning) !important;
    background: rgba(245, 158, 11, 0.05);
}

.email-item[data-category="OFERTA_WSPÓŁPRACY"] {
    border-left-color: var(--success) !important;
}

.email-item[data-priority="WYSOKI"] {
    border-left-color: var(--danger) !important;
    background: rgba(239, 68, 68, 0.05);
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-card);
    z-index: 1;
}

.modal-header h2 {
    color: var(--accent);
    font-size: 1.3rem;
    margin: 0;
    flex: 1;
    padding-right: 1rem;
}

.modal-close {
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.email-meta {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: grid;
    gap: 0.5rem;
}

.email-meta div {
    font-size: 0.9rem;
}

.email-meta strong {
    color: var(--accent);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.action-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.action-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Email Body */
.email-body-container {
    margin-bottom: 1.5rem;
}

.email-body-container h3 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.email-body-text {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

/* Reply Section */
.reply-section {
    border-top: 2px solid var(--border);
    padding-top: 1.5rem;
}

.reply-section h3 {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-primary:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: var(--border);
}

.suggestion-buttons {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.suggestion-btn {
    flex: 1;
    min-width: 150px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.suggestion-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

#reply-body {
    width: 100%;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    margin-top: 1rem;
}

#reply-body:focus {
    outline: none;
    border-color: var(--accent);
}

/* Users */
.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 0.6rem;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.user-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

.user-badge {
    background: var(--accent);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    white-space: nowrap;
}

/* Events / Astro Locations */
.event-item {
    background: var(--bg-secondary);
    padding: 0.75rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--warning);
}

.event-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

.event-date {
    font-size: 0.75rem;
    color: var(--accent);
    margin-bottom: 0.4rem;
}

.event-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 1.2rem;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem 0 1rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 1rem;
}

#install-btn {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive - Tablet */
@media (max-width: 1400px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .right-column {
        grid-column: span 2;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .container {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .current-time {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .right-column {
        grid-column: span 1;
    }
    
    .modal {
        padding: 1rem;
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    .suggestion-buttons {
        flex-direction: column;
    }
    
    .suggestion-btn {
        min-width: 100%;
    }
}

/* Audio player */
audio {
    width: 100%;
    margin-top: 0.5rem;
    border-radius: 8px;
}

/* NBA Player Summaries Card */
.nba-players-card {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
}

.player-summary-item {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid #ff6b35;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.player-summary-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.player-summary-item.no-game {
    border-left-color: #666;
    opacity: 0.6;
}

.player-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.player-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ff6b35;
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    margin: 0;
}

.game-matchup {
    font-size: 0.9rem;
    color: #aaa;
    margin: 0.25rem 0 0 0;
}

.game-result {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.game-result.win {
    background: #4caf50;
    color: white;
}

.game-result.loss {
    background: #f44336;
    color: white;
}

.player-stats {
    display: flex;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #ff6b35;
}

.stat-label {
    font-size: 0.75rem;
    color: #aaa;
    text-transform: uppercase;
}

.ai-summary {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #ddd;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border-left: 3px solid #ff6b35;
    font-style: italic;
}

.no-games-message {
    text-align: center;
    padding: 2rem;
    color: #aaa;
}

/* Responsywność dla mniejszych ekranów */
@media (max-width: 768px) {
    .player-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .stat-item {
        flex: 1 1 30%;
    }
}