/* Rooster Planner Frontend Styles */

:root {
    --rp-primary: #4F46E5;
    --rp-primary-dark: #4338CA;
    --rp-secondary: #10B981;
    --rp-danger: #EF4444;
    --rp-warning: #F59E0B;
    --rp-bg: #f9fafb;
    --rp-card-bg: #ffffff;
    --rp-text: #1f2937;
    --rp-text-muted: #6b7280;
    --rp-border: #e5e7eb;
    --rp-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --rp-radius: 12px;
    --rp-font: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Dark Theme */
.rp-container.rp-dark-theme {
    --rp-bg: #111827;
    --rp-card-bg: #1f2937;
    --rp-text: #f9fafb;
    --rp-text-muted: #9ca3af;
    --rp-border: #374151;
    --rp-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.rp-container.rp-dark-theme,
.rp-container.rp-dark-theme * {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme h1,
.rp-container.rp-dark-theme h2,
.rp-container.rp-dark-theme h3,
.rp-container.rp-dark-theme h4,
.rp-container.rp-dark-theme h5,
.rp-container.rp-dark-theme h6 {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme a {
    color: #818cf8;
}

.rp-container.rp-dark-theme .rp-card {
    background: #1f2937;
}

.rp-container.rp-dark-theme .rp-calendar-day {
    background: #1f2937;
    border-color: #374151;
}

.rp-container.rp-dark-theme .rp-calendar-day.other-month {
    background: #111827;
}

.rp-container.rp-dark-theme .rp-modal-content {
    background: #1f2937;
    color: #f9fafb;
}

.rp-container.rp-dark-theme input,
.rp-container.rp-dark-theme select,
.rp-container.rp-dark-theme textarea {
    background: #111827;
    color: #f9fafb;
    border-color: #374151;
}

/* Dark Theme - Extended */
.rp-container.rp-dark-theme,
.rp-container.rp-dark-theme * {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme h1,
.rp-container.rp-dark-theme h2,
.rp-container.rp-dark-theme h3,
.rp-container.rp-dark-theme h4,
.rp-container.rp-dark-theme h5,
.rp-container.rp-dark-theme h6 {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme p,
.rp-container.rp-dark-theme span,
.rp-container.rp-dark-theme div,
.rp-container.rp-dark-theme label {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme .rp-stat-value,
.rp-container.rp-dark-theme .rp-stat-label,
.rp-container.rp-dark-theme .rp-stat-content p,
.rp-container.rp-dark-theme .rp-stat-content h3 {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme .rp-stat-value {
    color: #818cf8;
}

.rp-container.rp-dark-theme .rp-location-item span,
.rp-container.rp-dark-theme .rp-shift-time,
.rp-container.rp-dark-theme .rp-shift-location,
.rp-container.rp-dark-theme .rp-empty,
.rp-container.rp-dark-theme .rp-chat-hint,
.rp-container.rp-dark-theme .rp-missing,
.rp-container.rp-dark-theme .rp-description,
.rp-container.rp-dark-theme .rp-month,
.rp-container.rp-dark-theme .rp-day-number,
.rp-container.rp-dark-theme .rp-weekday {
    color: var(--rp-text-muted);
}

.rp-container.rp-dark-theme .rp-action-item {
    background: #1f2937;
    color: var(--rp-text);
}

.rp-container.rp-dark-theme .rp-action-item:hover {
    background: #374151;
}

.rp-container.rp-dark-theme .rp-shift-item {
    background: #1f2937;
    border-left-color: #818cf8;
}

.rp-container.rp-dark-theme .rp-stat {
    background: #1f2937;
}

.rp-container.rp-dark-theme .rp-location-item {
    background: #1f2937;
}

.rp-container.rp-dark-theme .rp-tab {
    background: #1f2937;
    color: var(--rp-text);
}

.rp-container.rp-dark-theme .rp-tab.rp-active {
    background: #4F46E5;
    color: #fff;
}

.rp-container.rp-dark-theme .rp-calendar-header {
    background: #111827;
}

.rp-container.rp-dark-theme .rp-info-bar {
    background: #1f2937;
}

.rp-container.rp-dark-theme .rp-instructions {
    background: #064e3b;
    border-left-color: #10B981;
}

.rp-container.rp-dark-theme .rp-instructions h3,
.rp-container.rp-dark-theme .rp-instructions li {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme .rp-alert-info {
    background: #1e3a8a;
    border-color: #3b82f6;
}

.rp-container.rp-dark-theme .rp-alert-info strong,
.rp-container.rp-dark-theme .rp-alert-info p {
    color: #93c5fd;
}

.rp-container.rp-dark-theme .rp-btn-secondary {
    background: #374151;
    color: var(--rp-text);
    border-color: #4b5563;
}

.rp-container.rp-dark-theme .rp-btn-secondary:hover {
    background: #4b5563;
}

.rp-container.rp-dark-theme .rp-form-actions {
    background: #111827;
}

.rp-container.rp-dark-theme .rp-empty {
    background: #1f2937;
}

.rp-container.rp-dark-theme .rp-weekend {
    background: #111827;
}

.rp-container.rp-dark-theme .rp-today {
    background: #1e3a8a;
}

.rp-container.rp-dark-theme .rp-available {
    background: #064e3b;
}

.rp-container.rp-dark-theme .rp-unavailable {
    background: #451a03;
}

.rp-container.rp-dark-theme .rp-no-data {
    background: #1f2937;
}

.rp-container.rp-dark-theme .rp-toggle-text {
    background: #374151;
}

.rp-container.rp-dark-theme .rp-available .rp-toggle-text {
    background: #059669;
    color: #fff;
}

.rp-container.rp-dark-theme .rp-unavailable .rp-toggle-text {
    background: #dc2626;
    color: #fff;
}

.rp-container.rp-dark-theme .rp-shift-pref,
.rp-container.rp-dark-theme .rp-notes,
.rp-container.rp-dark-theme .rp-time-inputs input {
    background: #111827;
    color: var(--rp-text);
    border-color: #374151;
}

.rp-container.rp-dark-theme .rp-time-label {
    color: var(--rp-text-muted);
}

.rp-container.rp-dark-theme input[type="time"] {
    background: #111827;
    color: var(--rp-text);
    border-color: #374151;
}

.rp-container.rp-dark-theme select {
    background: #111827;
    color: var(--rp-text);
    border-color: #374151;
}

.rp-container.rp-dark-theme .rp-save-status .rp-saving {
    color: var(--rp-text-muted);
}

.rp-container.rp-dark-theme .rp-save-status .rp-saved {
    color: #34d399;
}

.rp-container.rp-dark-theme .rp-alert.rp-alert-warning strong,
.rp-container.rp-dark-theme .rp-alert.rp-alert-warning p {
    color: #fcd34d;
}

.rp-container.rp-dark-theme .rp-card,
.rp-container.rp-dark-theme .rp-calendar-wrapper {
    background: #1f2937;
}

.rp-container.rp-dark-theme .rp-card h2 {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme .rp-header h1 {
    color: var(--rp-text);
}

.rp-container.rp-dark-theme .rp-action-urgent {
    background: #451a03;
    color: #fca5a5;
}

.rp-container.rp-dark-theme .rp-action-urgent:hover {
    background: #7f1d1d;
}

/* Reset & Base */
.rp-container * {
    box-sizing: border-box;
}

.rp-container {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1f2937;
    line-height: 1.6;
}

.rp-container h1,
.rp-container h2,
.rp-container h3,
.rp-container h4,
.rp-container h5,
.rp-container h6 {
    color: #1f2937;
    font-weight: 700;
}

.rp-container p,
.rp-container span,
.rp-container div,
.rp-container label {
    color: #1f2937;
}

.rp-container a {
    color: #4F46E5;
}

/* Buttons */
.rp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rp-btn:hover {
    transform: translateY(-1px);
}

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

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

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

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

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

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

/* Notification Bell */
.rp-notification-bell {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--rp-card-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--rp-shadow);
    z-index: 999;
    transition: transform 0.2s;
}

.rp-notification-bell:hover {
    transform: scale(1.1);
}

.rp-bell-icon {
    font-size: 24px;
}

.rp-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--rp-danger);
    color: white;
    font-size: 12px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rp-notification-panel {
    position: fixed;
    top: 140px;
    right: 20px;
    width: 350px;
    max-height: 500px;
    background: var(--rp-card-bg);
    border-radius: var(--rp-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 998;
    overflow-y: auto;
}

/* Loading States */
.rp-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rp-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--rp-border);
    border-top-color: var(--rp-primary);
    border-radius: 50%;
    animation: rp-spin 1s linear infinite;
}

@keyframes rp-spin {
    to { transform: rotate(360deg); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .rp-container {
        padding: 10px !important;
        max-width: 100% !important;
        overflow-x: hidden;
    }
    
    .rp-notification-bell {
        top: auto;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
    
    .rp-notification-panel {
        top: auto;
        bottom: 90px;
        right: 10px;
        left: 10px;
        width: auto;
        max-height: 60vh;
    }
    
    .rp-btn {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
    }
    
    /* Header mobile styles */
    .rp-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .rp-header h1 {
        font-size: 1.4rem;
        margin: 0;
    }
    
    .rp-header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .rp-header-actions .rp-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Dashboard grid mobile */
    .rp-dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    
    .rp-card {
        padding: 15px;
    }
    
    .rp-card h2 {
        font-size: 16px;
    }
    
    /* Action grid - 2 columns on mobile */
    .rp-action-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px;
    }
    
    .rp-action-item {
        padding: 12px 8px;
    }
    
    .rp-icon {
        font-size: 20px;
    }
    
    .rp-action-item span:last-child {
        font-size: 12px;
        text-align: center;
    }
    
    /* Shift items mobile */
    .rp-shift-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 12px;
    }
    
    .rp-shift-actions {
        width: 100%;
    }
    
    .rp-shift-actions .rp-btn {
        width: 100%;
        text-align: center;
    }
    
    /* Availability calendar mobile */
    .rp-calendar-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    
    .rp-calendar {
        min-width: 700px;
    }
    
    .rp-calendar-header {
        min-width: 700px;
    }
    
    .rp-day {
        min-height: 100px;
        padding: 4px;
    }
    
    .rp-toggle-text {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .rp-shift-pref, .rp-notes {
        font-size: 11px;
        padding: 3px;
    }
    
    .rp-location-tabs {
        flex-wrap: wrap;
    }
    
    .rp-tab {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .rp-info-bar {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    
    .rp-form-actions {
        flex-direction: column;
        width: 100%;
        padding: 15px;
    }
    
    .rp-form-actions .rp-btn {
        width: 100%;
        justify-content: center;
    }
    
    .rp-instructions {
        padding: 15px;
    }
    
    .rp-instructions h3 {
        font-size: 14px;
    }
    
    .rp-instructions li {
        font-size: 13px;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .rp-container {
        padding: 8px !important;
    }
    
    .rp-header h1 {
        font-size: 1.2rem;
    }
    
    .rp-action-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .rp-action-item {
        padding: 10px 6px;
    }
    
    .rp-icon {
        font-size: 18px;
    }
    
    .rp-shift-date {
        display: flex;
        align-items: baseline;
        gap: 5px;
        min-width: auto;
    }
    
    .rp-day {
        font-size: 18px;
    }
    
    .rp-month {
        font-size: 11px;
    }
    
    .rp-shift-info h4 {
        font-size: 14px;
    }
    
    .rp-shift-time, .rp-shift-location {
        font-size: 12px;
    }
    
    .rp-alert {
        padding: 12px;
    }
    
    .rp-alert strong {
        font-size: 14px;
    }
    
    .rp-alert p {
        font-size: 13px;
    }
}

/* Touch-friendly */
@media (hover: none) and (pointer: coarse) {
    .rp-btn {
        min-height: 48px;
        min-width: 48px;
    }
    
    .rp-day {
        min-height: 80px;
    }
    
    input, select, textarea {
        font-size: 16px;
        padding: 10px;
    }
    
    .rp-toggle-text {
        width: 36px;
        height: 36px;
    }
    
    .rp-shift-pref, .rp-notes {
        min-height: 36px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --rp-bg: #111827;
        --rp-card-bg: #1f2937;
        --rp-text: #f9fafb;
        --rp-text-muted: #9ca3af;
        --rp-border: #374151;
    }
}

/* Custom Styles */
a.rp-btn.rp-btn-primary {
    color: white;
}
.rp-alert-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #1f2937;
}
.rp-alert.rp-alert-info {
    color: rgb(31, 41, 55);
}
.rp-btn-secondary {
    background: #e3e3e3;
}