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

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 30px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    color: #333;
    font-size: 2rem;
    margin-bottom: 15px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

#yearInput {
    width: 100px;
    padding: 8px 12px;
    font-size: 1.2rem;
    text-align: center;
    border: 2px solid #667eea;
    border-radius: 8px;
    outline: none;
}

#yearInput:focus {
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(118, 75, 162, 0.2);
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-nav {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-nav:hover {
    background: #764ba2;
    transform: scale(1.05);
}

.info-bar {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 0 8px 8px 0;
}

.info-bar p {
    color: #666;
    font-size: 0.9rem;
}

.neighbors-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.neighbors-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.neighbors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.neighbor-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.neighbor-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.neighbor-tag .order {
    background: rgba(255, 255, 255, 0.3);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.neighbor-tag .remove {
    background: rgba(255, 255, 255, 0.3);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    margin-left: 4px;
}

.neighbor-tag .remove:hover {
    background: #e74c3c;
}

.btn-add {
    background: #28a745;
    color: white;
}

.btn-add:hover {
    background: #218838;
}

.current-week-highlight {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.1rem;
    display: none;
}

.current-week-highlight.visible {
    display: block;
}

.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

td {
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    vertical-align: top;
}

.month-cell {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    width: 40px;
    min-width: 40px;
}

.week-cell {
    min-width: 120px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.week-cell:hover {
    background: #f8f9fa;
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

.week-cell.current-week {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border: 2px solid #28a745;
}

.week-cell .name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
    display: inline-block;
}

.week-cell .name:hover {
    background: #667eea;
    color: white;
}

.week-cell .dates {
    font-size: 0.8rem;
    color: #666;
}

.week-cell .week-number {
    font-size: 0.75rem;
    color: #999;
    margin-top: 4px;
}

footer {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.editable-address {
    color: #667eea;
    border-bottom: 1px dashed #667eea;
    cursor: text;
    padding: 2px 4px;
}

.editable-address:focus {
    outline: none;
    background: #f8f9fa;
    border-radius: 4px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.visible {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    outline: none;
}

.modal-content input:focus {
    border-color: #667eea;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-save {
    background: #28a745;
    color: white;
}

.btn-save:hover {
    background: #218838;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

.btn-cancel:hover {
    background: #5a6268;
}

/* Print styles - simple layout matching original format */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        background: white !important;
        padding: 0;
        margin: 0;
        font-family: serif;
        font-size: 14pt;
    }

    .container {
        box-shadow: none;
        padding: 0;
        border-radius: 0;
        max-width: none;
        width: 100%;
    }

    header h1 {
        text-align: center;
        color: black;
        margin-bottom: 10px;
        font-size: 20pt;
    }

    .controls,
    .info-bar,
    .neighbors-section,
    .btn,
    .current-week-highlight,
    footer {
        display: none !important;
    }

    .table-container {
        overflow: visible;
        width: 100%;
    }

    table {
        width: 100%;
        border-collapse: collapse;
        table-layout: fixed;
    }

    td {
        border: 1px solid black !important;
        padding: 4px;
        text-align: center;
    }

    .month-cell {
        background: white !important;
        color: black !important;
        font-weight: bold;
        font-style: normal;
        font-size: 18pt;
        border: 2px solid black !important;
        width: 25px;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .week-cell {
        min-width: auto;
        cursor: default;
        padding: 4px;
    }

    .week-cell:hover {
        background: transparent;
        transform: none;
        box-shadow: none;
    }

    .week-cell .name {
        font-weight: bold;
        font-size: 3.2vw !important;
        background: transparent !important;
        padding: 0;
        display: block;
        border-radius: 0;
        color: black;
    }

    .week-cell .dates {
        color: black;
        font-size: 2.1vw !important;
        white-space: nowrap;
    }

    .week-cell .week-number {
        display: none !important;
    }

    .week-cell.current-week {
        background: transparent !important;
        border: 1px solid black;
    }

    .emoji-icon {
        display: none !important;
    }
}

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

    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .month-cell {
        font-size: 0.85rem;
        width: 30px;
        min-width: 30px;
    }

    .week-cell {
        min-width: 100px;
        padding: 6px 8px;
    }

    .week-cell .name {
        font-size: 0.85rem;
    }

    .week-cell .dates {
        font-size: 0.7rem;
    }
}
