/* ========================================
   Reset & Base Styles
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overscroll-behavior: none;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    overscroll-behavior: none;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   Container & Logo
   ======================================== */
.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 450px;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-icon {
    font-size: 64px;
    animation: bounce 2s infinite;
}

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

h1 {
    text-align: center;
    color: #1f2937;
    margin-bottom: 10px;
    font-size: 28px;
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 30px;
    font-size: 14px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-buttons .btn {
    flex: 1;
}

/* ========================================
   Messages
   ======================================== */
.error, .success {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    font-size: 14px;
}

.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

/* ========================================
   Toggle Form
   ======================================== */
.toggle-form {
    text-align: center;
    margin-top: 20px;
    color: #6b7280;
    font-size: 14px;
}

.toggle-form a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
}

.toggle-form a:hover {
    text-decoration: underline;
}

/* ========================================
   Loading
   ======================================== */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   App Container & Header
   ======================================== */
#app-container {
    display: none;
    max-width: 1600px;
    margin: 0 auto;
}

.app-header {
    background: white;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
    gap: 10px;
}

.app-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.username {
    color: #4b5563;
    font-weight: 600;
    font-size: 14px;
}

.btn-logout {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn-logout:hover {
    background: #dc2626;
}

.btn-install-pwa {
    background: #10b981;
    color: white;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.btn-install-pwa:hover {
    background: #059669;
}

/* ========================================
   Calendar
   ======================================== */
#calendar-root {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.calendar-year-header {
    display: flex;
}

.calendar-year {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
}

.calendar-nav-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.calendar-nav-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.calendar-nav-btn:active {
    transform: scale(0.95);
}

.calendar-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    flex-shrink: 0;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.month-container {
    background: #f9fafb;
    border-radius: 12px;
    padding: 15px;
    border: 2px solid #e5e7eb;
}

.month-header {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.weekday-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.weekday-name {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    padding: 5px 2px;
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
    background: white;
    border: 2px solid transparent;
    min-height: 36px;
}

.calendar-day.empty {
    background: transparent;
}

.calendar-day.today {
    border: 2px solid #667eea;
    font-weight: 700;
}

/* Elternfarben */
.calendar-day.parent1 {
    background: #fef3c7;
    border-color: #fbbf24;
}

.calendar-day.parent2 {
    background: #dbeafe;
    border-color: #3b82f6;
}

/* Ferien-Indikator */
.calendar-day.ferien::before {
    content: '🌴';
    position: absolute;
    top: 1px;
    right: 1px;
    font-size: 9px;
    opacity: 0.9;
    z-index: 2;
}

/* Feiertage */
.calendar-day.feiertag,
.calendar-day.holiday {
    background: #fee2e2;
    border-color: #ef4444;
}

/* Feiertag MIT Betreuung */
.calendar-day.feiertag-mit-betreuung {
    border: 2px solid #ef4444;
}

.calendar-day.has-schulferien {
    border-style: dashed !important;
    border-width: 2px;
    border-color: #8b5cf6 !important;
}

.calendar-day.has-schulferien::after {
    content: '🎓';
    position: absolute;
    top: 1px;
    left: 1px;
    font-size: 8px;
    opacity: 0.7;
}

.day-number {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
}

/* ========================================
   Betreuungen Liste
   ======================================== */
.ferien-list {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ferien-header {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.ferien-header h3 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 12px;
}

.ferien-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-add-ferien {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.btn-add-ferien:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}

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

.btn-add-ferien.btn-holiday {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-add-ferien.btn-holiday:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

.btn-add-ferien.btn-admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-add-ferien.btn-admin:hover {
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.ferien-item {
    background: #f9fafb;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 2px solid #e5e7eb;
    transition: all 0.2s;
}

.ferien-item:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.ferien-item-info {
    flex: 1;
    min-width: 0;
}

.ferien-item-date {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 5px;
    font-size: 14px;
}

.ferien-item-parent {
    color: #6b7280;
    font-size: 13px;
    word-break: break-word;
}

.btn-delete-ferien {
    background: #ef4444;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-delete-ferien:hover {
    background: #dc2626;
}

.btn-delete-ferien:active {
    transform: scale(0.95);
}

.calendar-members {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e5e7eb;
}

.members-title {
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    font-size: 14px;
}

.members-list {
    color: #1f2937;
    font-size: 14px;
}

.open-share-link {
    color: #10b981;
    text-decoration: none;
    font-weight: 600;
}

.open-share-link:hover {
    text-decoration: underline;
}

/* ========================================
   Modals
   ======================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
    padding: 20px;
}

.modal-overlay[style*="display: block"],
.modal-overlay[style*="display: flex"] {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 25px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
}

.modal-content.modal-wide {
    max-width: 900px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-description {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 14px;
}

/* ========================================
   Share Modal
   ======================================== */
.invitation-display {
    background: #f0fdf4;
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.invitation-label {
    color: #065f46;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
}

.invitation-code {
    font-size: 28px;
    font-weight: 700;
    color: #059669;
    letter-spacing: 3px;
    margin: 15px 0;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.invitation-expiry {
    color: #6b7280;
    font-size: 12px;
    margin-bottom: 15px;
}

.join-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e5e7eb;
}

.join-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 15px;
    font-size: 14px;
}

.join-input-group {
    display: flex;
    gap: 10px;
}

.join-code-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 2px;
    font-family: 'Courier New', monospace;
}

/* ========================================
   Holiday Settings
   ======================================== */
.holiday-card {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px solid #e5e7eb;
}

.holiday-card-christmas {
    background: #fef3c7;
    border-color: #fbbf24;
}

.holiday-card-silvester {
    background: #dbeafe;
    border-color: #3b82f6;
}

.holiday-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.holiday-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.holiday-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
}

.holiday-subtitle {
    font-size: 12px;
    color: #6b7280;
}

.holiday-inputs {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 15px;
}

.holiday-inputs label {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.holiday-year-input,
.holiday-parent-select {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.holiday-preview {
    background: white;
    padding: 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #374151;
    line-height: 1.6;
}

/* ========================================
   Admin Settings
   ======================================== */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-tab {
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #6b7280;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.admin-tab:hover {
    color: #1f2937;
}

.admin-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.admin-tab-content {
    display: none;
}

.schulferien-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.schulferien-item {
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 2px solid #e5e7eb;
}

.schulferien-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}

.schulferien-info {
    flex: 1;
    min-width: 0;
}

.schulferien-name {
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 3px;
    font-size: 14px;
}

.schulferien-dates {
    color: #6b7280;
    font-size: 12px;
}

.btn-delete-schulferien {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.btn-delete-schulferien:hover {
    transform: scale(1.2);
}

.btn-delete-schulferien:active {
    transform: scale(1);
}

/* ========================================
   Bottom Navigation
   ======================================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    display: none;
    justify-content: space-around;
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid #e5e7eb;
}

.nav-item {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    background: none;
    color: #6b7280;
    flex: 1;
    max-width: 100px;
    -webkit-tap-highlight-color: transparent;
}

.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active {
    color: #667eea;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.nav-item.active svg {
    stroke: #667eea;
}

.nav-item span {
    font-size: 10px;
    font-weight: 600;
}

/* ========================================
   Monatsansicht Navigation
   ======================================== */
.month-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 12px;
}

.month-nav-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    color: #667eea;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.month-nav-btn:hover {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.month-nav-btn:active {
    transform: scale(0.9);
}

.current-month-display {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
}

.current-year-display {
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
}

.single-month-view {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.single-month-view .month-container {
    border: none;
    background: transparent;
    padding: 0;
}

.single-month-view .month-header {
    display: none;
}

/* Legende kompakt */
.calendar-legend-compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 10px;
}

.legend-item-compact {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #4b5563;
}

.legend-color-compact {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ========================================
   Toast Notification
   ======================================== */
.toast-notification {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #10b981;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 600;
    font-size: 14px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 90%;
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   Confirm Dialog
   ======================================== */
.confirm-dialog-overlay {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.confirm-dialog-content {
    max-width: 400px;
    text-align: center;
}

.confirm-dialog-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.confirm-dialog-message {
    font-size: 16px;
    color: #374151;
    margin-bottom: 25px;
    line-height: 1.5;
}

.confirm-dialog-content .form-buttons {
    justify-content: center;
}

.confirm-dialog-content .btn {
    min-width: 120px;
}

/* ========================================
   Responsive Design - Mobile First
   ======================================== */

/* Tablets und größer */
@media (min-width: 769px) {
    .bottom-nav {
        display: none !important;
    }
    
    #app-container {
        padding-bottom: 0;
    }
    
    .calendar-legend-compact {
        display: none;
    }
    
    .calendar-legend {
        display: flex;
    }
    
    .month-navigation {
        display: none;
    }
    
    .single-month-view {
        display: none;
    }
    
    .calendar-year-header {
        display: flex !important;
    }
    
    .calendar-grid {
        display: grid;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    body {
        padding: 10px;
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    /* Auth Container */
    .container {
        padding: 30px 20px;
        border-radius: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .logo-icon {
        font-size: 48px;
    }
    
    /* App Header Mobile */
    .app-header {
        padding: 10px 12px;
        margin-bottom: 10px;
        border-radius: 10px;
    }
    
    .app-title {
        font-size: 16px;
    }
    
    .username {
        font-size: 12px;
        display: none; /* Auf sehr kleinen Screens ausblenden */
    }
    
    .user-info {
        gap: 6px;
    }
    
    .btn-logout {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .btn-install-pwa {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-install-pwa span:last-child {
        display: none; /* Text ausblenden, nur Icon */
    }
    
    /* Calendar Root */
    #calendar-root {
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
    
    /* Hide year view elements */
    .calendar-year-header {
        display: none !important;
    }
    
    .calendar-legend {
        display: none !important;
    }
    
    .calendar-grid {
        display: none !important;
    }
    
    /* Show month view elements */
    .month-navigation {
        display: flex;
    }
    
    .single-month-view {
        display: block;
    }
    
    .calendar-legend-compact {
        display: grid;
    }
    
    /* Ferien List */
    .ferien-list {
        padding: 15px;
        border-radius: 12px;
        margin-bottom: 10px;
    }
    
    .ferien-header h3 {
        font-size: 18px;
    }
    
    .ferien-buttons {
        width: 100%;
    }
    
    .ferien-buttons .btn-add-ferien {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 8px 8px;
    }
    
    .ferien-buttons .btn-add-ferien span:first-child {
        font-size: 14px;
    }
    
    .ferien-item {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }
    
    .ferien-item-info {
        width: 100%;
        text-align: center;
    }
    
    .btn-delete-ferien {
        width: 100%;
    }
    
    /* Calendar Day Mobile */
    .calendar-day {
        min-height: 40px;
        border-radius: 8px;
    }
    
    .day-number {
        font-size: 14px;
    }
    
    .calendar-day.ferien::before {
        font-size: 10px;
        top: 2px;
        right: 2px;
    }
    
    .calendar-day.has-schulferien::after {
        font-size: 9px;
        top: 2px;
        left: 2px;
    }
    
    /* Modals */
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-content {
        padding: 20px;
        border-radius: 12px;
        max-height: 85vh;
    }
    
    .modal-header {
        font-size: 18px;
        margin-bottom: 15px;
        padding-bottom: 12px;
    }
    
    .modal-description {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    /* Form Rows Mobile */
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* Holiday Settings Mobile */
    .holiday-inputs {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .holiday-icon {
        font-size: 28px;
    }
    
    .holiday-title {
        font-size: 15px;
    }
    
    .holiday-preview {
        font-size: 11px;
    }
    
    /* Join Input Group Mobile */
    .join-input-group {
        flex-direction: column;
    }
    
    .join-code-input {
        font-size: 14px;
    }
    
    /* Invitation Code Mobile */
    .invitation-code {
        font-size: 22px;
        letter-spacing: 2px;
    }
    
    /* Admin Settings Mobile */
    .admin-tabs {
        gap: 5px;
        margin-bottom: 15px;
    }
    
    .admin-tab {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .schulferien-controls {
        flex-direction: column;
    }
    
    .schulferien-controls .btn-add-ferien,
    .schulferien-controls .btn {
        width: 100%;
    }
    
    /* Bottom Navigation anzeigen */
    .bottom-nav {
        display: flex !important;
    }
    
    #app-container {
        padding-bottom: 80px;
    }
    
    /* Toast Mobile */
    .toast-notification {
        bottom: 90px;
        left: 10px;
        right: 10px;
        max-width: none;
        transform: translateX(0) translateY(20px);
    }
    
    .toast-notification.show {
        transform: translateX(0) translateY(0);
    }
    
    /* Weekday Names Mobile */
    .weekday-name {
        font-size: 10px;
    }
}

/* Very Small Phones */
@media (max-width: 380px) {
    .app-title {
        font-size: 14px;
    }
    
    .btn-add-ferien span:last-child {
        display: none;
    }
    
    .btn-add-ferien {
        padding: 8px 10px;
        justify-content: center;
    }
    
    .ferien-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .calendar-legend-compact {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    
    .legend-item-compact {
        font-size: 10px;
    }
    
    .calendar-day {
        min-height: 35px;
    }
    
    .day-number {
        font-size: 12px;
    }
    
    .weekday-name {
        font-size: 9px;
        padding: 3px 1px;
    }
    
    .month-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .current-month-display {
        font-size: 16px;
    }
    
    .current-year-display {
        font-size: 12px;
    }
    
    .nav-item {
        padding: 4px 8px;
    }
    
    .nav-item svg {
        width: 20px;
        height: 20px;
    }
    
    .nav-item span {
        font-size: 9px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 5px;
    }
    
    .app-header {
        padding: 8px 10px;
    }
    
    #calendar-root {
        padding: 10px;
    }
    
    .month-navigation {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .calendar-legend-compact {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .single-month-view {
        padding: 10px;
    }
    
    .bottom-nav {
        padding: 4px 0;
    }
    
    .nav-item {
        padding: 4px 8px;
        gap: 2px;
    }
    
    .nav-item svg {
        width: 18px;
        height: 18px;
    }
    
    .nav-item span {
        font-size: 9px;
    }
}

/* Prevent zoom on input focus (iOS) */
@media (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    input[type="email"],
    input[type="number"],
    input[type="date"],
    input[type="color"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Safe Area für iPhone X und neuer */
@supports (padding: max(0px)) {
    body {
        padding-left: max(10px, env(safe-area-inset-left));
        padding-right: max(10px, env(safe-area-inset-right));
    }
    
    .bottom-nav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
}

/* Touch-optimierungen */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .btn-primary,
    .btn-secondary,
    .btn-logout,
    .btn-add-ferien,
    .btn-delete-ferien,
    .month-nav-btn,
    .calendar-nav-btn,
    .nav-item {
        min-height: 44px;
        min-width: 44px;
    }
    
    .calendar-day {
        cursor: pointer;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .app-header,
    .bottom-nav,
    .btn-logout,
    .btn-install-pwa,
    .btn-add-ferien,
    .btn-delete-ferien,
    .ferien-buttons,
    .modal-overlay {
        display: none !important;
    }
    
    #calendar-root {
        box-shadow: none;
        padding: 0;
    }
    
    .calendar-day {
        border: 1px solid #000 !important;
        break-inside: avoid;
    }
}