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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Login Screen */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    margin-bottom: 30px;
    text-align: center;
    color: #333;
}

.error-message {
    color: #e74c3c;
    background: #ffebee;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Hide admin-only elements for viewers */
.admin-only.hidden {
    display: none !important;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* Navigation */
.main-nav {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 10px 20px;
    border: none;
    background: #ecf0f1;
    color: #2c3e50;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: #d5dbdb;
}

.nav-btn.active {
    background: #3498db;
    color: white;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-small {
    padding: 5px 12px;
    font-size: 12px;
}

/* Views */
.view {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.view-header h2 {
    font-size: 20px;
    color: #2c3e50;
}

/* Gemeindeblatt List */
.gemeindeblatt-list {
    display: grid;
    gap: 15px;
}

.gemeindeblatt-card {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background: #fafafa;
    transition: all 0.3s;
}

.gemeindeblatt-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.gemeindeblatt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.gemeindeblatt-card-header h3 {
    font-size: 18px;
    color: #2c3e50;
}

.gemeindeblatt-card-actions {
    display: flex;
    gap: 8px;
}

.gemeindeblatt-card-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    font-size: 13px;
    color: #555;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-label {
    font-weight: 600;
    color: #7f8c8d;
    margin-bottom: 3px;
}

.detail-value {
    color: #2c3e50;
}

/* Vacation List */
.vacation-list {
    display: grid;
    gap: 10px;
}

.vacation-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background: #fff3cd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vacation-info h4 {
    font-size: 16px;
    color: #856404;
    margin-bottom: 5px;
}

.vacation-dates {
    font-size: 13px;
    color: #856404;
}

.vacation-actions {
    display: flex;
    gap: 8px;
}

/* Planning Controls */
.planning-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.planning-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.planning-controls input,
.planning-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Planning Actions */
.planning-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.toggle-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    color: #555;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background: #f5f5f5;
}

.toggle-btn.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

/* Planning Table */
.kw-header {
    margin: 25px 0 15px 0;
    padding: 10px 15px;
    background: #34495e;
    color: white;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
}

.kw-header:first-child {
    margin-top: 0;
}

.planning-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 10px;
}

.planning-table th,
.planning-table td {
    padding: 10px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.planning-table th {
    background: #34495e;
    color: white;
    font-weight: 600;
}

.planning-table tr:nth-child(even) {
    background: #f9f9f9;
}

.planning-table tr:hover {
    background: #ecf0f1;
}

.date-changed {
    background: #fff3cd !important;
}

.date-changed-marker {
    display: inline-block;
    background: #ffc107;
    color: #856404;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 5px;
}

/* Calendar */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.calendar-month {
    margin-bottom: 30px;
}

.calendar-month-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: #7f8c8d;
    font-size: 12px;
    padding: 5px;
}

.calendar-day {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
    min-height: 100px;
    background: white;
}

.calendar-day.other-month {
    opacity: 0.3;
}

.calendar-day.today {
    background: #e8f4f8;
    border-color: #3498db;
}

.calendar-day-number {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.calendar-event {
    font-size: 11px;
    padding: 3px 5px;
    margin: 3px 0;
    border-radius: 3px;
    background: #3498db;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.clickable {
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

.calendar-event.clickable:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    filter: brightness(1.1);
}

.calendar-event.deadline {
    background: #e67e22;
}

.calendar-event.print {
    background: #9b59b6;
}

.calendar-event.changed {
    background: #e74c3c;
}

.calendar-event.sonderverteilung {
    border-left: 3px solid #e67e22;
    font-weight: 600;
}

/* PDF Controls */
.pdf-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: #ecf0f1;
    border-radius: 6px;
}

.pdf-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.pdf-controls input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.pdf-preview {
    display: grid;
    gap: 20px;
}

.pdf-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background: #f9f9f9;
}

.pdf-item h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.pdf-files {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.pdf-file-badge {
    padding: 5px 10px;
    background: #3498db;
    color: white;
    border-radius: 4px;
    font-size: 12px;
}

.pdf-preview-text {
    margin-top: 10px;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    white-space: pre-wrap;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    overflow: auto;
}

.modal.active {
    display: block;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input[type="time"],
.form-group input[type="number"] {
    width: auto;
    margin-right: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        flex-direction: column;
        gap: 15px;
    }

    .main-nav {
        flex-direction: column;
    }

    .planning-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .planning-controls label {
        width: 100%;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }
}

/* Detail View Styles */
.detail-section {
    padding: 10px 0;
}

.detail-row {
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.detail-label-large {
    font-weight: 600;
    color: #2c3e50;
    font-size: 15px;
    margin-bottom: 8px;
}

.detail-value-large {
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

/* Holidays & Blocked Days */
.holiday-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
}

.holiday-controls label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.holiday-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.holidays-display {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.holiday-item {
    padding: 12px 15px;
    background: #e8f4f8;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.holiday-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.holiday-date {
    color: #555;
    font-size: 13px;
}

.blocked-days-list {
    display: grid;
    gap: 10px;
}

.blocked-day-item {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background: #fff9e6;
    border-left: 4px solid #f39c12;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blocked-day-info h4 {
    font-size: 16px;
    color: #e67e22;
    margin-bottom: 5px;
}

.blocked-day-date {
    font-size: 13px;
    color: #856404;
}

.blocked-day-actions {
    display: flex;
    gap: 8px;
}

/* Custom Publication Dates */
.custom-dates-list {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    background: #fafafa;
}

.custom-date-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 8px;
}

.custom-date-item:last-child {
    margin-bottom: 0;
}

.custom-date-item span {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}
