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

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    width: 100%;
}

.container {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0 10px;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
}

.logo-section {
    display: flex;
    gap: 15px;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
    background: white;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.title-section {
    text-align: center;
}

.title-section h1 {
    font-size: 2.2em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.title-section h2 {
    font-size: 1.4em;
    font-weight: normal;
    font-style: italic;
    opacity: 0.9;
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9em;
}

.info-section > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    border-radius: 4px;
    min-width: 200px;
}

.label {
    font-weight: bold;
}

.value {
    font-weight: normal;
}

/* Shift Selector */
.shift-selector {
    background: #f8fafc;
    padding: 15px 20px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.shift-label {
    font-weight: bold;
    color: #374151;
}

.shift-select {
    padding: 8px 12px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 1em;
    color: #374151;
    min-width: 280px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.shift-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Action Bar */
.action-bar {
    background: #ffffff;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

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

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background: #4b5563;
}

.btn-info {
    background: #06b6d4;
    color: white;
}

.btn-info:hover {
    background: #0891b2;
}

.btn-warning {
    background: #f59e0b;
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.save-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.save-status {
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.save-status.saved {
    background: #dcfce7;
    color: #166534;
}

.save-status.saving {
    background: #fef3c7;
    color: #92400e;
}

.save-status.error {
    background: #fecaca;
    color: #991b1b;
}

/* Icon styles */
.icon-save::before { content: "💾"; }
.icon-export::before { content: "📁"; }
.icon-print::before { content: "🖨️"; }
.icon-reset::before { content: "🔄"; }

.shift-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Main Agenda Container */
.agenda-container {
    padding: 20px;
    overflow-x: auto;
    width: 100%;
    background: #ffffff;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    border: 2px solid #1e3a8a;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.agenda-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    background-color: white;
    min-width: 1200px;
}

.agenda-table th,
.agenda-table td {
    border: 1px solid #d1d5db;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
}

/* Header Styles */
.agenda-table thead tr:first-child th {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    font-weight: bold;
    font-size: 11px;
    padding: 12px 8px;
}

.agenda-table thead tr:last-child th {
    background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    color: white;
    font-weight: bold;
    font-size: 10px;
    padding: 8px;
}

/* Column Widths */
.task-col {
    width: 30%;
    min-width: 350px;
    max-width: 500px;
}

.time-col {
    width: 12%;
    min-width: 120px;
}

.duration-col {
    width: 8%;
    min-width: 80px;
}

.ok-col,
.nok-col {
    width: 3%;
    min-width: 40px;
}

.comments-col {
    width: 15%;
    min-width: 150px;
}

.reaction-col {
    width: 12%;
    min-width: 120px;
}

/* Section Rows */
.section-row {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.section-title {
    font-weight: bold;
    font-size: 14px;
    color: #1f2937;
    text-align: center;
    padding: 12px !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Task Cells */
.task-text {
    text-align: left;
    padding: 10px !important;
    line-height: 1.4;
    font-size: 11px;
    font-weight: 500;
}

.time-cell {
    font-size: 10px;
    line-height: 1.3;
    padding: 8px !important;
    background-color: #f8fafc;
}

.duration-cell {
    font-size: 11px;
    font-weight: bold;
    color: #1e3a8a;
    background-color: #f0f9ff;
}

/* Checkbox Cells */
.checkbox-cell {
    padding: 4px !important;
    background-color: #fafafa;
}

.checkbox-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #22c55e;
}

.checkbox-cell:nth-child(even) {
    background-color: #f0fdf4;
}

.checkbox-cell:nth-child(odd) {
    background-color: #fef2f2;
}

/* Comments and Reaction Cells */
.comments-cell {
    padding: 4px !important;
}

.comments-cell textarea {
    width: 100%;
    height: 40px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 4px;
    font-size: 10px;
    resize: vertical;
    font-family: inherit;
}

.comments-cell textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.reaction-cell {
    background-color: #fffbeb;
    font-size: 10px;
}

/* Alternating Row Colors */
.agenda-table tbody tr:nth-child(even):not(.section-row) {
    background-color: #f9fafb;
}

.agenda-table tbody tr:nth-child(odd):not(.section-row) {
    background-color: white;
}

/* Hover Effects */
.agenda-table tbody tr:not(.section-row):hover {
    background-color: #e0f2fe;
    transition: background-color 0.2s ease;
}

/* Footer */
.footer {
    background: #f8fafc;
    border-top: 2px solid #e2e8f0;
    padding: 20px;
    margin-top: 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
}

.legend h3, .instructions h3, .completion-info h3 {
    color: #1f2937;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid #374151;
}

.ok-color {
    background: #10b981;
}

.nok-color {
    background: #ef4444;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 6px 0;
    padding-left: 20px;
    position: relative;
}

.instructions li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

/* Progress Bar Styles */
.completion-info {
    text-align: center;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 30px;
    background: #e5e7eb;
    border-radius: 15px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #374151;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .agenda-table {
        font-size: 11px;
    }
    
    .task-col {
        min-width: 250px;
    }
    
    .time-col {
        min-width: 100px;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .info-section {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 0;
    }
    
    .header {
        padding: 15px;
    }
    
    .header-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 15px;
    }
    
    .logo {
        height: 40px;
    }
    
    .title-section h1 {
        font-size: 1.6em;
    }
    
    .title-section h2 {
        font-size: 1.1em;
    }
    
    .agenda-container {
        padding: 10px;
    }
    
    .agenda-table {
        font-size: 10px;
        min-width: 800px;
    }
    
    .task-col {
        min-width: 200px;
        width: 35%;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Print Styles */
@media print {
    body {
        margin: 0;
        padding: 0;
        font-size: 12px;
    }
    
    .container {
        box-shadow: none;
        max-width: none;
        margin: 0;
    }
    
    .header {
        background: white !important;
        color: black !important;
        border: 2px solid black;
        page-break-inside: avoid;
    }
    
    .shift-selector,
    .action-bar {
        display: none !important;
    }
    
    .agenda-table {
        page-break-inside: auto;
        border-collapse: collapse;
        width: 100%;
        font-size: 10px;
    }
    
    .agenda-table th {
        background: #f0f0f0 !important;
        color: black !important;
        border: 1px solid black !important;
        padding: 4px !important;
        font-weight: bold;
    }
    
    .agenda-table td {
        border: 1px solid black !important;
        padding: 3px !important;
        vertical-align: top;
    }
    
    .section-row {
        background: #e0e0e0 !important;
        font-weight: bold;
        page-break-inside: avoid;
        page-break-after: avoid;
    }
    
    .task-text {
        font-size: 9px;
        max-width: 300px;
        word-wrap: break-word;
    }
    
    .time-cell {
        font-size: 8px;
        white-space: nowrap;
    }
    
    .checkbox-cell {
        text-align: center;
        min-width: 20px;
    }
    
    .checkbox-cell input[type="checkbox"] {
        -webkit-appearance: checkbox;
        appearance: checkbox;
        width: 12px;
        height: 12px;
    }
    
    .comments-cell textarea {
        border: 1px solid #ccc;
        font-size: 8px;
        min-height: 30px;
        width: 100%;
    }
    
    .footer {
        background: white !important;
        border-top: 2px solid black;
        page-break-inside: avoid;
        margin-top: 20px;
    }
    
    .footer-content {
        font-size: 10px;
    }
    
    /* Force page breaks for long content */
    tbody tr:nth-child(20n) {
        page-break-after: always;
    }
}
