/**
 * Restaurant Staff Rota Enhanced - Frontend Styles
 * Mobile-first, touch-optimized design for staff
 */

:root {
    --brand-color: #2196F3;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
}

/* Reset and Base */
.rota-view {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text-dark);
}

.rota-view * {
    box-sizing: border-box;
}

/* Header */
.rota-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, var(--brand-color) 0%, #1976d2 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 8px 24px rgba(33, 150, 243, 0.25);
}

.restaurant-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
    filter: brightness(0) invert(1);
}

.rota-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.week-info {
    margin: 0;
    opacity: 0.95;
    font-size: 16px;
    font-weight: 500;
}

/* Action Buttons */
.rota-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.rota-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: var(--brand-color);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.rota-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

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

.rota-btn-secondary {
    background: white;
    color: var(--brand-color);
    border: 2px solid var(--brand-color);
}

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

/* Schedule Layout - Desktop */
.rota-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* Day Card */
.day-schedule {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.day-schedule:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.day-schedule h3 {
    margin: 0;
    padding: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.day-schedule h3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
}

/* Shifts Container */
.shifts {
    padding: 16px;
}

.shift {
    background: var(--bg-light);
    padding: 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    border-left: 4px solid var(--brand-color);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.shift:last-child {
    margin-bottom: 0;
}

.shift:hover {
    background: #e3f2fd;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

.shift::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--brand-color) 0%, rgba(33, 150, 243, 0.5) 100%);
}

.staff-name {
    display: block;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.shift-time {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

.shift-time::before {
    content: '🕐';
    font-size: 16px;
}

.no-shifts {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
}

.no-shifts::before {
    content: '😴';
    display: block;
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

/* My Shifts View (Personal) */
.my-shifts {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.my-shifts-header {
    text-align: center;
    margin-bottom: 30px;
}

.my-shifts-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: var(--text-dark);
}

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

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-color);
    margin-bottom: 5px;
}

.summary-label {
    font-size: 13px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.my-shift-card {
    background: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-left: 5px solid var(--brand-color);
}

.my-shift-day {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.my-shift-time {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.my-shift-duration {
    display: inline-block;
    padding: 6px 12px;
    background: #e3f2fd;
    color: var(--brand-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Calendar Export */
.calendar-export {
    text-align: center;
    margin-top: 30px;
    padding: 25px;
    background: var(--bg-light);
    border-radius: 12px;
}

.calendar-export h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
}

/* Confirmation Badge */
.confirmation-badge {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: var(--success-color);
    color: white;
    border-radius: 8px;
    font-weight: 600;
}

.confirmation-badge::before {
    content: '✓ ';
    font-weight: 700;
}

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

.shift {
    animation: slideIn 0.3s ease-out backwards;
}

.shift:nth-child(1) { animation-delay: 0.05s; }
.shift:nth-child(2) { animation-delay: 0.1s; }
.shift:nth-child(3) { animation-delay: 0.15s; }
.shift:nth-child(4) { animation-delay: 0.2s; }
.shift:nth-child(5) { animation-delay: 0.25s; }

/* Loading State */
.rota-loading {
    text-align: center;
    padding: 60px 20px;
}

.rota-loading::before {
    content: '⏳';
    display: block;
    font-size: 64px;
    margin-bottom: 20px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Motivational Footer */
.rota-footer {
    margin-top: 40px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    text-align: center;
    color: white;
}

.rota-footer-message {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.rota-footer-emoji {
    font-size: 32px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .rota-view {
        padding: 15px;
    }
    
    .rota-header {
        padding: 25px 15px;
        border-radius: 12px;
    }
    
    .rota-header h2 {
        font-size: 24px;
    }
    
    .week-info {
        font-size: 14px;
    }
    
    .rota-schedule {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .day-schedule {
        border-radius: 10px;
    }
    
    .day-schedule h3 {
        font-size: 16px;
        padding: 14px;
    }
    
    .shifts {
        padding: 12px;
    }
    
    .shift {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .staff-name {
        font-size: 15px;
    }
    
    .shift-time {
        font-size: 13px;
    }
    
    .rota-btn {
        width: 100%;
        justify-content: center;
        padding: 14px;
        font-size: 16px;
    }
    
    .my-shifts-summary {
        grid-template-columns: 1fr 1fr;
    }
    
    .summary-value {
        font-size: 28px;
    }
}

/* Touch Interactions */
@media (hover: none) and (pointer: coarse) {
    .shift:active {
        background: #bbdefb;
        transform: scale(0.98);
    }
    
    .rota-btn:active {
        transform: scale(0.95);
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .rota-view {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .day-schedule {
        background: #2a2a2a;
    }
    
    .shift {
        background: #333;
        color: #e0e0e0;
    }
    
    .shift:hover {
        background: #3a3a3a;
    }
    
    .my-shift-card {
        background: #2a2a2a;
    }
    
    .summary-card {
        background: #2a2a2a;
    }
}

/* Print Styles */
@media print {
    .rota-actions,
    .rota-btn,
    .rota-footer {
        display: none !important;
    }
    
    .rota-schedule {
        grid-template-columns: repeat(7, 1fr);
    }
    
    .day-schedule {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .shift {
        break-inside: avoid;
    }
}