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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: linear-gradient(135deg, #2d1b69 0%, #1a0e3d 50%, #0f051f 100%);
    min-height: 100vh;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: #ffffff;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #744c9e 0%, #5a3277 100%);
    color: #ffffff;
    padding: 40px 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="stars" width="10" height="10" patternUnits="userSpaceOnUse"><circle cx="5" cy="5" r="0.5" fill="%23ffffff" opacity="0.2"/></pattern></defs><rect width="100" height="100" fill="url(%23stars)"/></svg>') repeat;
    opacity: 0.3;
}

.header h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.tagline {
    font-size: 1.1em;
    margin-bottom: 20px;
    opacity: 0.9;
    font-weight: 400;
    color: #e2e8f0;
    position: relative;
    z-index: 1;
}

.stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

.separator {
    opacity: 0.6;
}

.status-connected {
    color: #68d391;
    font-weight: 600;
}

.status-disconnected {
    color: #fc8181;
    font-weight: 600;
}

/* Main Content */
.main-content {
    background: #f7fafc;
    min-height: calc(100vh - 140px);
    padding: 30px;
}

/* User Section */
.user-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.user-input {
    display: flex;
    gap: 25px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

#username {
    flex: 0 0 250px;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    background: #f7fafc;
    transition: all 0.2s ease;
}

#username:focus {
    outline: none;
    border-color: #744c9e;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(116, 76, 158, 0.1);
}

.week-selector {
    display: flex;
    gap: 15px;
    background: #f7fafc;
    padding: 8px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

.week-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 14px;
}

.week-selector label:hover {
    background: rgba(116, 76, 158, 0.1);
}

.week-selector input[type="radio"] {
    margin: 0;
}

.week-selector input[type="radio"]:checked + span {
    color: #744c9e;
    font-weight: 600;
}

/* Availability Section */
.availability-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.availability-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
}

.availability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.day-column {
    background: #f7fafc;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.day-column:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.day-header {
    font-weight: 600;
    color: #744c9e;
    text-align: center;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.day-name {
    font-size: 14px;
    font-weight: 600;
    color: #744c9e;
}

.day-date {
    font-size: 11px;
    font-weight: 400;
    color: #718096;
    text-transform: none;
}

.day-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.day-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.day-options label:hover {
    background: rgba(116, 76, 158, 0.1);
}

.day-options input[type="radio"] {
    margin: 0;
}

.day-options input[type="radio"]:checked + * {
    font-weight: 600;
}

.submit-btn {
    display: block;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    background: linear-gradient(135deg, #744c9e 0%, #5a3277 100%);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(116, 76, 158, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 76, 158, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Results Section */
.results-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h3 {
    color: #2d3748;
    font-size: 1.4em;
    font-weight: 600;
}

.results-stats {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9em;
    color: #718096;
    font-weight: 500;
}

.results-container {
    min-height: 200px;
}

.no-responses {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.no-responses p {
    margin-bottom: 10px;
    font-size: 16px;
}

.no-responses p:first-child {
    font-size: 18px;
    font-weight: 600;
    color: #4a5568;
}

.results-table {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    background: white;
}

.results-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.results-table th,
.results-table td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.results-table thead {
    background: linear-gradient(135deg, #744c9e 0%, #5a3277 100%);
    color: white;
}

.results-table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #5a3277;
    position: relative;
}

.table-day-header {
    min-width: 80px;
    padding: 8px 4px;
    text-align: center;
    vertical-align: middle;
}

.table-day-name {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    display: block;
    color: rgba(255, 255, 255, 1);
    text-transform: uppercase;
}

.table-day-date {
    font-size: 10px;
    opacity: 0.9;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-transform: none;
    display: block;
    margin: 0;
}

.player-header {
    text-align: left !important;
    padding-left: 20px;
    min-width: 140px;
    background: rgba(255, 255, 255, 0.1);
}

.results-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #edf2f7;
}

.results-table tbody tr:hover {
    background: #f7fafc;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-table tbody tr:last-child {
    border-bottom: none;
}

.player-name {
    text-align: left !important;
    font-weight: 700;
    color: #744c9e;
    min-width: 140px;
    padding-left: 20px;
    font-size: 15px;
    position: relative;
}

.player-name::before {
    content: '👤';
    margin-right: 8px;
    opacity: 0.7;
}

.availability-cell {
    min-width: 80px;
    position: relative;
    cursor: default;
    transition: all 0.2s ease;
    padding: 12px 8px;
    border-radius: 8px;
    margin: 2px;
}

.availability-cell:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.availability-emoji {
    display: block;
    font-size: 18px;
    margin-bottom: 4px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.availability-text {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.availability-cell.yes {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
    color: #155724;
}

.availability-cell.yes .availability-text {
    color: #155724;
}

.availability-cell.maybe {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    color: #856404;
}

.availability-cell.maybe .availability-text {
    color: #856404;
}

.availability-cell.no {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border: 2px solid #dc3545;
    color: #721c24;
}

.availability-cell.no .availability-text {
    color: #721c24;
}

/* Enhanced hover effects for availability cells */
.availability-cell.yes:hover {
    background: linear-gradient(135deg, #c3e6cb 0%, #b1dfbb 100%);
    border-color: #1e7e34;
}

.availability-cell.maybe:hover {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-color: #e0a800;
}

.availability-cell.no:hover {
    background: linear-gradient(135deg, #f5c6cb 0%, #f1b0b7 100%);
    border-color: #bd2130;
}

/* Custom Scrollbar */
.results-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.results-container::-webkit-scrollbar-track {
    background: #edf2f7;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Media Queries for Responsive Design */
@media (max-width: 1024px) {
    .availability-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .day-column {
        padding: 10px;
    }
    
    .day-options label {
        font-size: 12px;
        padding: 8px 6px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2.2em;
    }
    
    .tagline {
        font-size: 1em;
    }
    
    .stats {
        font-size: 0.8em;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .user-input {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    #username {
        flex: none;
        width: 100%;
    }
    
    .week-selector {
        justify-content: center;
    }
    
    .availability-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .day-column {
        padding: 12px;
    }
    
    .availability-section,
    .results-section {
        padding: 20px;
    }
    
    .results-header {
        flex-direction: column;
        text-align: center;
    }
    
    .results-table {
        font-size: 12px;
    }
    
    .results-table th,
    .results-table td {
        padding: 12px 6px;
    }
    
    .player-header,
    .player-name {
        min-width: 100px;
        padding-left: 12px;
        font-size: 13px;
    }
    
    .table-day-header {
        min-width: 60px;
        padding: 8px 4px;
    }
    
    .table-day-name {
        font-size: 11px;
        margin-bottom: 2px;
    }
    
    .table-day-date {
        font-size: 9px;
    }
    
    .availability-cell {
        min-width: 60px;
        padding: 8px 4px;
    }
    
    .availability-emoji {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .availability-text {
        font-size: 8px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.9em;
    }
    
    .container {
        border-radius: 0;
    }
    
    .user-section,
    .availability-section,
    .results-section {
        border-radius: 12px;
        padding: 20px;
    }
    
    .availability-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .day-column {
        padding: 10px;
    }
    
    .day-options label {
        font-size: 12px;
        padding: 4px 6px;
    }
    
    .results-table {
        font-size: 10px;
    }
    
    .results-table th,
    .results-table td {
        padding: 8px 3px;
    }
    
    .player-header,
    .player-name {
        min-width: 80px;
        padding-left: 8px;
        font-size: 12px;
    }
    
    .player-name::before {
        display: none;
    }
    
    .table-day-header {
        min-width: 50px;
        padding: 6px 2px;
    }
    
    .table-day-name {
        font-size: 10px;
        margin-bottom: 1px;
    }
    
    .table-day-date {
        font-size: 8px;
    }
    
    .availability-cell {
        min-width: 50px;
        padding: 6px 2px;
        border-width: 1px;
    }
    
    .availability-emoji {
        font-size: 14px;
        margin-bottom: 1px;
    }
    
    .availability-text {
        font-size: 7px;
    }
    
    .availability-cell:hover {
        transform: none;
    }
    
    .results-table tbody tr:hover {
        transform: none;
    }
}