﻿/* Production Calendar Styling - German Manufacturing Interface */

/* Calendar Card Container */
.calendar-card {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

    .calendar-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

/* Calendar Month Container */
.calendar-month {
    display: grid;
    grid-template-rows: auto repeat(5, 1fr);
    width: 100%;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
}

/* Calendar Header Row (Weekdays) */
.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    padding: 0;
}

.calendar-header-cell {
    padding: 12px 8px;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

    .calendar-header-cell:last-child {
        border-right: none;
    }

/* Calendar Week Rows */
.calendar-week-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid #e5e7eb;
}

    .calendar-week-row:last-child {
        border-bottom: none;
    }

/* Calendar Day Cells */
.calendar-day-cell {
    position: relative;
    min-height: 60px;
    border-right: 1px solid #e5e7eb;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    padding: 8px 4px;
}

    .calendar-day-cell:last-child {
        border-right: none;
    }

    .calendar-day-cell:hover {
        background: #f8fafc;
        transform: translateY(-1px);
        box-shadow: inset 0 0 0 2px #3b82f6;
    }

    .calendar-day-cell:focus {
        outline: 2px solid #3b82f6;
        outline-offset: -2px;
        z-index: 10;
    }

/* Calendar Day Number */
.calendar-day-number {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    z-index: 2;
    position: relative;
}

/* Production Day Status Styling */
.production-day-active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
}

    .production-day-active .calendar-day-number {
        color: white;
        font-weight: 600;
    }

    .production-day-active:hover {
        background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    }

.production-day-green-blue {
    background: linear-gradient( to bottom, #22c55e 0%, #22c55e 50%, #60a5fa 50%, #60a5fa 100% );
    color: white;
}

.production-day-green-blue .calendar-day-number {
    color: white;
    font-weight: 600;
}

.production-day-green-blue:hover {
    background: linear-gradient( to bottom, #16a34a 0%, #16a34a 50%, #3b82f6 50%, #3b82f6 100% );
}


.production-day-red-blue {
    background: linear-gradient( to bottom, #ef4444 0%, #ef4444 50%, #60a5fa 50%, #60a5fa 100% );
    color: white;
}

    .production-day-red-blue .calendar-day-number {
        color: white;
        font-weight: 600;
    }

    .production-day-red-blue:hover {
        background: linear-gradient( to bottom, #dc2626 0%, #dc2626 50%, #3b82f6 50%, #3b82f6 100% );
    }

/* Weekend Styling */
.production-day-feiertag {
    background: linear-gradient(135deg, #a2d6ef 0%, #62add1 100%);
}

    .production-day-feiertag .calendar-day-number {
        color: white;
    }

    .production-day-feiertag:hover {
        background: linear-gradient(135deg, #62add1 0%, #469dc7 100%);
    }

.production-day-inactive {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

    .production-day-inactive .calendar-day-number {
        color: white;
        font-weight: 600;
    }

    .production-day-inactive:hover {
        background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
    }

/* Today Highlighting */
.production-day-today {
    border: 3px solid #fbbf24;
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.3);
    font-weight: 700;
}

    .production-day-today .calendar-day-number {
        font-weight: 700;
        font-size: 1rem;
    }

/* Weekend Styling */
.production-day-weekend {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

    .production-day-weekend .calendar-day-number {
        color: white;
    }

    .production-day-weekend:hover {
        background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
    }




/* Outside Month Days (Grayed Out) */
.calendar-day-outside-month {
    opacity: 0.4;
    background: #f9fafb !important;
}

    .calendar-day-outside-month .calendar-day-number {
        color: #9ca3af !important;
    }

    .calendar-day-outside-month:hover {
        opacity: 0.6;
        transform: none;
        box-shadow: none;
    }

/* Calendar Day Indicators */
.calendar-today-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    color: #fbbf24;
    font-size: 0.75rem;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.calendar-no-production-indicator {
    position: absolute;
    bottom: 4px;
    right: 4px;
    color: white;
    font-size: 0.75rem;
    z-index: 3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Traffic Light Indicators for Multi-Shift Display */
.traffic-light-container {
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 4;
}

.traffic-light-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: rgba(128, 128, 128, 0.3);
    transition: all 0.2s ease;
}

    .traffic-light-indicator.active {
        box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
    }

/* Individual Shift Indicators */
.shift-frueh.active {
    background: #f97316; /* Orange for Frühschicht */
    border-color: #ea580c;
    box-shadow: 0 0 6px rgba(249, 115, 22, 0.6);
}

.shift-spaet.active {
    background: #3b82f6; /* Blue for Spätschicht */
    border-color: #2563eb;
    box-shadow: 0 0 6px rgba(59, 130, 246, 0.6);
}

.shift-nacht.active {
    background: #8b5cf6; /* Purple for Nachtschicht */
    border-color: #7c3aed;
    box-shadow: 0 0 6px rgba(139, 92, 246, 0.6);
}

/* Shift Pre-Selection Buttons */
.shift-selection-toolbar {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.shift-selection-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.shift-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 2px solid transparent;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    background: white;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

    .shift-button:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    }

    .shift-button.selected {
        color: white;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

.shift-button-frueh {
    border-color: #f97316;
}

    .shift-button-frueh:hover {
        background: #fff7ed;
        border-color: #ea580c;
    }

    .shift-button-frueh.selected {
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
        border-color: #c2410c;
    }

.shift-button-spaet {
    border-color: #3b82f6;
}

    .shift-button-spaet:hover {
        background: #eff6ff;
        border-color: #2563eb;
    }

    .shift-button-spaet.selected {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
        border-color: #1d4ed8;
    }

.shift-button-nacht {
    border-color: #8b5cf6;
}

    .shift-button-nacht:hover {
        background: #f5f3ff;
        border-color: #7c3aed;
    }

    .shift-button-nacht.selected {
        background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
        border-color: #6d28d9;
    }

.shift-button-clear {
    border-color: #ef4444;
    color: #dc2626;
}

    .shift-button-clear:hover {
        background: #fef2f2;
        border-color: #dc2626;
    }

    .shift-button-clear.selected {
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        border-color: #b91c1c;
        color: white;
    }

.shift-indicator-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.shift-mode-indicator {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    margin-left: auto;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* Mobile Responsiveness for Shift Controls */
@media (max-width: 768px) {
    .shift-selection-toolbar {
        padding: 8px 12px;
    }

    .shift-button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .traffic-light-container {
        left: 2px;
    }

    .traffic-light-indicator {
        width: 6px;
        height: 6px;
        gap: 1px;
    }
}

@media (max-width: 576px) {
    .shift-selection-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .shift-button {
        justify-content: center;
        width: 100%;
    }
}

/* Legend Styling */
.calendar-legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    display: inline-block;
    border: 1px solid #d1d5db;
}

/* Clickable Day Enhancement */
.calendar-day-clickable {
    position: relative;
}

    .calendar-day-clickable::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(59, 130, 246, 0.1);
        opacity: 0;
        transition: opacity 0.2s ease;
        pointer-events: none;
    }

    .calendar-day-clickable:hover::before {
        opacity: 1;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .calendar-month {
        font-size: 0.8rem;
    }

    .calendar-day-cell {
        min-height: 50px;
        padding: 4px 2px;
    }

    .calendar-day-number {
        font-size: 0.75rem;
    }

    .calendar-header-cell {
        padding: 8px 4px;
        font-size: 0.75rem;
    }

    .calendar-today-indicator,
    .calendar-no-production-indicator {
        font-size: 0.625rem;
    }
}

@media (max-width: 576px) {
    .calendar-month {
        font-size: 0.75rem;
    }

    .calendar-day-cell {
        min-height: 40px;
        padding: 2px 1px;
    }

    .calendar-day-number {
        font-size: 0.7rem;
    }

    .calendar-header-cell {
        padding: 6px 2px;
        font-size: 0.7rem;
    }
}

/* Print Styles */
@media print {
    .calendar-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .calendar-day-cell {
        border: 1px solid #000;
    }

    .production-day-active {
        background: #e5e7eb !important;
        color: #000 !important;
    }

        .production-day-active::after {
            content: '✓';
            position: absolute;
            font-weight: bold;
        }

    .production-day-inactive {
        background: #f3f4f6 !important;
        color: #000 !important;
    }

        .production-day-inactive::after {
            content: '✗';
            position: absolute;
            font-weight: bold;
        }
}

/* Accessibility Enhancements */
@media (prefers-reduced-motion: reduce) {
    .calendar-day-cell,
    .calendar-day-clickable::before {
        transition: none;
    }

        .calendar-day-cell:hover {
            transform: none;
        }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .calendar-day-cell {
        border: 2px solid #000;
    }

    .production-day-active {
        background: #000 !important;
        color: #fff !important;
    }

    .production-day-inactive {
        background: #fff !important;
        color: #000 !important;
        border: 2px solid #000;
    }
}

/* Focus Management for Screen Readers */
.calendar-day-cell[tabindex="0"]:focus {
    outline: 3px solid #3b82f6;
    outline-offset: 2px;
    z-index: 15;
}

/* Animation for Status Changes */
@keyframes statusChange {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.calendar-day-cell.status-changing {
    animation: statusChange 0.3s ease-in-out;
}

/* Loading State Overlay */
.calendar-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

/* German Manufacturing Theme Colors */
:root {
    --production-green: #10b981;
    --production-red: #ef4444;
    --production-blue: #1e40af;
    --production-gold: #fbbf24;
    --production-gray: #6b7280;
    --calendar-border: #e5e7eb;
    --calendar-hover: #f8fafc;
}

/* ============================================
   YEARLY CALENDAR STYLES
   ============================================ */

/* Yearly Calendar Container */
.yearly-calendar-card {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    overflow-x: auto; /* Allow horizontal scrolling for wide yearly calendar */
}

.yearly-calendar {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    background-color: #e9ecef;
    min-width: 1200px; /* Minimum width for proper display */
    font-size: 11px;
}

/* Yearly Calendar Headers */
.yearly-calendar-header-row {
    display: contents;
}

.yearly-calendar-month-header {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    color: white;
    padding: 10px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 14px;
    border-bottom: 2px solid #343a40;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Yearly Calendar Day Rows */
.yearly-calendar-day-row {
    display: contents;
}

/* Yearly Calendar Day Cells */
.yearly-calendar-day-cell {
    background-color: white;
    border: 1px solid #dee2e6;
    padding: 3px;
    min-height: 35px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.2s ease;
}

    .yearly-calendar-day-cell.yearly-day-clickable {
        cursor: pointer;
    }

        .yearly-calendar-day-cell.yearly-day-clickable:hover {
            background-color: #f8f9fa;
            transform: scale(1.02);
            z-index: 1;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

    .yearly-calendar-day-cell.yearly-day-empty {
        background-color: #f8f9fa;
        cursor: default;
    }

/* Yearly Day Content Styling */
.yearly-day-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2px;
}

.yearly-day-name {
    font-size: 12px;
    color: #6c757d;
    font-weight: 600;
}

.yearly-day-number {
    font-size: 11px;
    font-weight: bold;
    color: #495057;
}

/* Text colors for production status backgrounds in yearly calendar */
.yearly-calendar-day-cell.production-day-active .yearly-day-number,
.yearly-calendar-day-cell.production-day-active .yearly-day-name {
    color: white;
}

.yearly-calendar-day-cell.production-day-inactive .yearly-day-number,
.yearly-calendar-day-cell.production-day-inactive .yearly-day-name {
    color: white;
}

.yearly-calendar-day-cell.production-day-weekend .yearly-day-number,
.yearly-calendar-day-cell.production-day-weekend .yearly-day-name {
    color: white;
}

/* Yearly Traffic Light System - Horizontal Layout */
.yearly-traffic-lights {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
    margin-top: auto;
}

.yearly-traffic-light {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

    .yearly-traffic-light.active {
        border: 1px solid rgba(0, 0, 0, 0.2);
        box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
    }

/* Yearly Shift Colors - Same as Monthly */
.yearly-shift-frueh.active {
    background-color: #f97316; /* Orange for Frühschicht */
    border-color: #ea580c;
}

.yearly-shift-spaet.active {
    background-color: #3b82f6; /* Blue for Spätschicht */
    border-color: #2563eb;
}

.yearly-shift-nacht.active {
    background-color: #8b5cf6; /* Purple for Nachtschicht */
    border-color: #7c3aed;
}

/* Yearly Production Status Colors - Exact Match with Monthly Calendar */
.yearly-calendar-day-cell.production-day-active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    border-color: #16a34a;
}

.yearly-calendar-day-cell.production-day-inactive {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
}

.yearly-calendar-day-cell.production-day-weekend {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border-color: #4b5563;
}

.yearly-calendar-day-cell.production-day-today {
    border: 2px solid #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* Responsive Adjustments for Yearly Calendar */
@media (max-width: 1400px) {
    .yearly-calendar {
        font-size: 10px;
        min-width: 1000px;
    }

    .yearly-calendar-day-cell {
        min-height: 30px;
        padding: 2px;
    }

    .yearly-day-number {
        font-size: 10px;
    }

    .yearly-day-name {
        font-size: 10px;
    }

    .yearly-traffic-light {
        width: 6px;
        height: 6px;
    }
}

@media (max-width: 1200px) {
    .yearly-calendar {
        font-size: 9px;
        min-width: 900px;
    }

    .yearly-calendar-month-header {
        font-size: 12px;
        padding: 8px 3px;
    }

    .yearly-calendar-day-cell {
        min-height: 25px;
        padding: 1px;
    }

    .yearly-traffic-light {
        width: 5px;
        height: 5px;
    }
}

/* Print Styles for Yearly Calendar */
@media print {
    .yearly-calendar-card {
        box-shadow: none;
        border: 1px solid #000;
    }

    .yearly-calendar {
        font-size: 8px;
        grid-gap: 0;
    }

    .yearly-calendar-day-cell {
        min-height: 20px;
        padding: 1px;
        border: 0.5px solid #666;
    }

    .yearly-calendar-month-header {
        background: #333 !important;
        color: white !important;
        font-size: 10px;
        padding: 5px 2px;
    }
}
