/* Modern Professional Styling for LunchVote */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --background-light: #f8fafc;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 12px;
    --border-radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-gradient);
    min-height: 100vh;
    padding: 24px;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header Styling */
header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    padding: 32px 0;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.025em;
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: 8px;
}

/* Card Styling */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card h2 {
    margin-bottom: 16px;
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Form Styling */
form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    form {
        flex-direction: column;
    }
}

input[type="text"] {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    background: white;
}

/* Form Styling */
form {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

@media (max-width: 640px) {
    form {
        flex-direction: column;
    }
}

input[type="text"] {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    font-weight: 400;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="text"]::placeholder {
    color: var(--text-secondary);
}

/* Button Styling */
.btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    min-height: 36px;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

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

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

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

.btn-success:hover:not(:disabled) {
    background: #047857;
}

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

.btn-warning:hover:not(:disabled) {
    background: #b45309;
}

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

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn-nav {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    font-weight: 500;
}

.btn-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: var(--primary-color);
}

/* Calendar & Navigation Styling */
.calendar-navigation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.week-info {
    flex: 1;
    text-align: center;
}

.week-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(37, 99, 235, 0.1);
    padding: 6px 12px;
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

@media (max-width: 640px) {
    .calendar-navigation {
        flex-direction: column;
        gap: 12px;
    }
    
    .calendar-navigation .btn-nav {
        width: 100%;
        max-width: 200px;
    }
    
    .week-display {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

.week-view {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    flex: 1;
    max-width: 500px;
    margin: 0 auto;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.week-view::-webkit-scrollbar {
    display: none;
}

@media (max-width: 640px) {
    .week-view {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
        max-width: 100%;
        padding: 0 4px;
    }
}

@media (max-width: 480px) {
    .week-view {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
        padding: 0 2px;
    }
}

.day-card {
    padding: 8px 6px;
    background: white;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    min-height: 55px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    scroll-snap-align: start;
}

@media (max-width: 640px) {
    .day-card {
        padding: 6px 4px;
        min-height: 50px;
    }
}

@media (max-width: 480px) {
    .day-card {
        padding: 6px 4px;
        min-height: 45px;
        border-radius: 4px;
    }
}

.day-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-1px) scale(1.02);
    box-shadow: var(--shadow-md);
}

@media (max-width: 480px) {
    .day-card:hover {
        transform: translateY(-1px) scale(1.01);
    }
}

.day-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.day-card.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.day-card.today {
    border-color: var(--success-color);
    background: rgba(5, 150, 105, 0.05);
}

.day-card.today::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
}

/* Activity indicators */
.day-card.has-proposals::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 6px;
    height: 6px;
    background: var(--warning-color);
    border-radius: 50%;
    z-index: 1;
}

.day-card.has-votes::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    z-index: 1;
}

.day-card.has-votes.has-proposals::before {
    background: linear-gradient(45deg, var(--primary-color) 50%, var(--warning-color) 50%);
}

/* Activity count badges */
.day-card .activity-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--primary-color);
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 8px;
    min-width: 12px;
    text-align: center;
    line-height: 1.2;
}

.day-card.has-proposals .activity-count {
    background: var(--warning-color);
}

.day-card.has-votes .activity-count {
    background: var(--primary-color);
}

@media (max-width: 480px) {
    .day-card.today::after {
        top: 3px;
        right: 3px;
        width: 6px;
        height: 6px;
    }
    
    .day-card.has-proposals::before,
    .day-card.has-votes::before {
        top: 3px;
        left: 3px;
        width: 5px;
        height: 5px;
    }
    
    .day-card.has-votes::before {
        width: 6px;
        height: 6px;
    }
    
    .day-card .activity-count {
        bottom: 1px;
        right: 1px;
        font-size: 0.55rem;
        padding: 1px 3px;
        min-width: 10px;
    }
}

.day-card.selected.today {
    background: var(--primary-color);
    border-color: var(--primary-dark);
}

.day-card.selected.today::after {
    background: rgba(255, 255, 255, 0.8);
}

.day-card .day-name {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 640px) {
    .day-card .day-name {
        font-size: 0.65rem;
        margin-bottom: 1px;
    }
}

@media (max-width: 480px) {
    .day-card .day-name {
        font-size: 0.6rem;
        letter-spacing: 0.25px;
    }
}

.day-card .day-number {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
}

@media (max-width: 640px) {
    .day-card .day-number {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .day-card .day-number {
        font-size: 1.15rem;
    }
}

.day-card .day-month {
    font-size: 0.6rem;
    opacity: 0.7;
    margin-top: 1px;
}

@media (max-width: 640px) {
    .day-card .day-month {
        font-size: 0.55rem;
    }
}

.selected-date-display {
    background: rgba(37, 99, 235, 0.1);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-color);
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    margin-top: 16px;
    margin-bottom: 16px;
}

@media (max-width: 640px) {
    .selected-date-display {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Calendar Legend */
.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
    padding: 8px;
    background: rgba(248, 250, 252, 0.8);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

@media (max-width: 640px) {
    .calendar-legend {
        gap: 10px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    .calendar-legend {
        flex-direction: column;
        gap: 6px;
        align-items: center;
    }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.today-dot {
    background: var(--success-color);
}

.proposals-dot {
    background: var(--warning-color);
}

.votes-dot {
    background: var(--primary-color);
}

/* Proposals List Styling */
.proposals-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.proposal-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.proposal-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
    background: rgba(37, 99, 235, 0.02);
}

.proposal-info {
    flex: 1;
}

.proposal-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.proposal-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.btn-vote {
    background: var(--success-color);
    color: white;
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-vote:hover:not(:disabled) {
    background: #047857;
}

.btn-vote:disabled {
    background: var(--secondary-color);
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
    padding: 4px 6px;
    font-size: 0.7rem;
    border-radius: 4px;
    min-width: auto;
    line-height: 1;
}

.btn-delete:hover:not(:disabled) {
    background: #b91c1c;
}

/* Results Section */
.results {
    margin-bottom: 16px;
}

.result-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item.winner {
    border-color: var(--success-color);
    background: rgba(5, 150, 105, 0.05);
}

.result-item.winner .result-name::before {
    content: "🏆 ";
    margin-right: 4px;
}

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

.result-votes {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 35px;
    text-align: center;
}

.vote-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 4px;
    width: 100%;
}

.vote-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transition: width 0.5s ease;
}

/* Round Controls */
.round-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
}

@media (max-width: 640px) {
    .round-controls {
        flex-direction: column;
    }
}

/* History Section */
.history {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.history-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.history-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.history-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.history-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.history-result.winner {
    font-weight: 600;
    color: var(--success-color);
}

.history-result.winner::before {
    content: "🏆 ";
}

/* Utility Classes */
.loading {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 32px;
}

.info {
    text-align: center;
    color: var(--text-secondary);
    padding: 24px;
    background: rgba(100, 116, 139, 0.1);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(220, 38, 38, 0.2);
    margin-bottom: 16px;
    font-weight: 500;
}

.success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(5, 150, 105, 0.2);
    margin-bottom: 16px;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 48px;
    padding: 24px 0;
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.125rem;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .card h2 {
        font-size: 1.5rem;
    }
    
    .proposal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .proposal-item {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .proposal-info {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .proposal-actions {
        justify-content: space-between;
        gap: 8px;
    }
    
    .btn-vote {
        flex: 1;
    }
    
    .vote-count {
        align-self: flex-end;
        margin-left: 0;
    }
    
    .calendar-navigation .btn-nav {
        font-size: 0.875rem;
        padding: 10px 16px;
    }
}

@media (max-width: 640px) {
    .container {
        max-width: 100%;
    }
    
    form {
        flex-direction: column;
        gap: 12px;
    }
    
    .round-controls {
        flex-direction: column;
        gap: 12px;
    }
    
    .round-controls .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    
    header {
        padding: 20px 0;
        margin-bottom: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 12px;
    }
    
    .card h2 {
        font-size: 1.25rem;
        margin-bottom: 16px;
    }
    
    .btn {
        padding: 10px 14px;
        font-size: 0.85rem;
    }
    
    .proposal-item {
        padding: 10px 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .proposal-info {
        flex-direction: row;
        align-items: center;
    }
    
    .proposal-name {
        font-size: 0.9rem;
    }
    
    .vote-count {
        padding: 2px 6px;
        font-size: 0.7rem;
        min-width: 30px;
    }
    
    .btn-vote {
        padding: 6px 10px;
        font-size: 0.75rem;
        flex: 1;
    }
    
    .btn-delete {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .result-item {
        padding: 8px 10px;
        margin-bottom: 4px;
    }
    
    .result-name {
        font-size: 0.85rem;
    }
    
    .result-votes {
        font-size: 0.7rem;
        padding: 1px 6px;
        min-width: 30px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

.card {
    animation: fadeIn 0.4s ease;
}

.proposal-item {
    animation: slideIn 0.3s ease;
}

.btn:hover {
    animation: pulse 0.3s ease;
}

.error {
    animation: shake 0.5s ease;
}

/* Enhanced hover effects */
.day-card:hover {
    transform: translateY(-2px) scale(1.02);
}

.proposal-item:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Focus styles for accessibility */
.btn:focus,
input:focus,
.day-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .btn {
        display: none;
    }
}


