/* Reset og base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Button reset */
button {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    font: inherit;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 10px;
    --radius-sm: 6px;
    
    /* Mer dempet/sofistikert fargepalett */
    --template-monthly: #8b7fc8;
    --template-horizontal: #5b9bd5;
    --template-vertical: #4fb3a0;
    --accent-color: #f59e0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, #e8eaf6 0%, #e1bee7 25%, #b3e5fc 50%, #c5e1f5 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    animation: fadeIn 0.6s ease-out;
}

/* Skip to content link for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
}

.skip-to-content:focus {
    top: 0;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 4rem;
}

header h1 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: #6366f1;
}

.site-title-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.site-title-icon {
    width: 40px;
    height: 40px;
    stroke-width: 1.8;
    color: #6366f1;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.75;
    font-weight: 400;
    color: rgba(31, 41, 55, 0.7);
    margin-top: 0.25rem;
}

/* Templates grid */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.75rem;
    margin-bottom: 2rem;
}

/* Template card */
.template-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(229, 231, 235, 0.8);
    animation: slideUp 0.5s ease-out backwards;
    min-height: 600px;
}

.template-card:nth-child(1) {
    animation-delay: 0.1s;
}

.template-card:nth-child(2) {
    animation-delay: 0.2s;
}

.template-card:nth-child(3) {
    animation-delay: 0.3s;
}

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

.template-card[data-template="monthly"] {
    border-top: 3px solid var(--template-monthly);
}

.template-card[data-template="horizontal"] {
    border-top: 3px solid var(--template-horizontal);
}

.template-card[data-template="vertical"] {
    border-top: 3px solid var(--template-vertical);
}

.template-card[data-template="menu"] {
    border-top: 3px solid var(--accent-color);
}

.template-card[data-template="timetable"] {
    border-top: 3px solid #8b5cf6;
}

.template-card[data-template="activity"] {
    border-top: 3px solid #ec4899;
}

.template-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 24px -5px rgba(0, 0, 0, 0.15), 0 8px 12px -3px rgba(0, 0, 0, 0.1);
}

.template-card:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.template-preview {
    padding: 1.5rem 1.25rem;
    background: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Template icon wrapper with background circle */
.template-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
    position: relative;
}

.template-card[data-template="monthly"] .template-icon-wrapper {
    background: linear-gradient(135deg, rgba(139, 127, 200, 0.3), rgba(139, 127, 200, 0.4));
}

.template-card[data-template="horizontal"] .template-icon-wrapper {
    background: linear-gradient(135deg, rgba(91, 155, 213, 0.3), rgba(91, 155, 213, 0.4));
}

.template-card[data-template="vertical"] .template-icon-wrapper {
    background: linear-gradient(135deg, rgba(79, 179, 160, 0.3), rgba(79, 179, 160, 0.4));
}

.template-card[data-template="menu"] .template-icon-wrapper {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.4));
}

.template-card[data-template="timetable"] .template-icon-wrapper {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.25), rgba(139, 92, 246, 0.35));
}

.template-card[data-template="activity"] .template-icon-wrapper {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(236, 72, 153, 0.4));
}

.template-icon {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
    color: var(--text-primary);
}

.template-card[data-template="monthly"] .template-icon {
    color: var(--template-monthly);
}

.template-card[data-template="horizontal"] .template-icon {
    color: var(--template-horizontal);
}

.template-card[data-template="vertical"] .template-icon {
    color: var(--template-vertical);
}

.template-card[data-template="menu"] .template-icon {
    color: var(--accent-color);
}

.template-card[data-template="timetable"] .template-icon {
    color: #8b5cf6;
}

.template-card[data-template="activity"] .template-icon {
    color: #ec4899;
}

.template-preview h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
    letter-spacing: -0.01em;
}

.template-description {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1rem 0;
    text-align: center;
    line-height: 1.5;
    opacity: 0.8;
}

/* Template preview image */
.template-preview-image {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.preview-img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: white;
    border: 1px solid var(--border-color);
}

.preview-monthly-container {
    width: 100%;
    max-width: 100%;
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

.preview-month-header {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.preview-monthly-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: auto 1fr;
    gap: 0.1rem;
    row-gap: 0.15rem;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.preview-day-header {
    text-align: center;
    font-size: 0.45rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.05rem 0.05rem;
    background: #f9fafb;
    border-radius: 2px;
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
    line-height: 1;
    height: 0.9rem;
    max-height: 0.9rem;
    min-height: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-month-day {
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: 3px;
    padding: 0.1rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    height: 100%;
}

.preview-month-day.empty {
    background: #f9fafb;
    border-color: #f3f4f6;
}

.preview-day-num {
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

.preview-month-lines {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.06rem;
    min-height: 0;
}

.preview-month-line {
    height: 0.3em;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
}

/* Week preview */
.week-preview {
    width: 100%;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.week-preview.horizontal {
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.preview-week-header {
    margin-bottom: 0.6rem;
    flex-shrink: 0;
}

.preview-week-number {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-primary);
}

.preview-horizontal-week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    flex: 1;
    min-height: 0;
}

.preview-day {
    border: 1px solid var(--border-color);
    padding: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-height: 80px;
    background: white;
}

.preview-day-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    padding: 0.3rem;
    border-bottom: 1px solid var(--border-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
    background: #f3f4f6;
    color: #1f2937;
    border-radius: 0;
    flex-shrink: 0;
}

.preview-activity-lines {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    min-height: 0;
    flex: 1;
    padding: 0.45rem;
}

.preview-activity-line {
    height: 0.55em;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
}

/* Timetable preview */
.week-preview.timetable {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.preview-timetable-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
}

.preview-timetable-week-header {
    flex-shrink: 0;
}

.preview-timetable-grid {
    --timetable-columns: 5;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.85);
}

.preview-timetable-header-row,
.preview-timetable-row {
    display: grid;
    grid-template-columns: 90px repeat(var(--timetable-columns, 5), 1fr);
}

.preview-timetable-header-row {
    background: #f3f4f6;
}

.preview-timetable-time-header,
.preview-timetable-day-header {
    padding: 0.4rem 0.25rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    border-right: 1px solid var(--border-color);
    color: #1f2937;
}

.preview-timetable-header-row div:last-child {
    border-right: none;
}

.preview-timetable-body {
    display: flex;
    flex-direction: column;
}

.preview-timetable-row {
    background: #ffffff;
    min-height: 42px;
    border-top: 1px solid var(--border-color);
}

.preview-timetable-row:first-child {
    border-top: none;
}

.preview-timetable-time-cell,
.preview-timetable-cell {
    padding: 0.3rem 0.25rem;
    font-size: 0.68rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    color: var(--text-secondary);
}

.preview-timetable-time-cell {
    background: #f9fafb;
    font-weight: 600;
    color: var(--text-primary);
    justify-content: center;
}

.preview-timetable-row div:last-child {
    border-right: none;
}

.week-preview.vertical {
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.9rem;
    border: 1px solid var(--border-color);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.preview-vertical-container {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.preview-vertical-week-header {
    margin-bottom: 0.6rem;
    flex-shrink: 0;
}

.preview-vertical-week {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.preview-vertical-header-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px 4px 0 0;
    background: #f3f4f6;
}

.preview-vertical-day-header,
.preview-vertical-column-header {
    padding: 0.4rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border-right: 1px solid var(--border-color);
    color: #1f2937;
}

.preview-vertical-column-header:last-child {
    border-right: none;
}

.preview-vertical-day-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border-color);
    border-top: none;
}

.preview-vertical-day-row:last-child {
    border-radius: 0 0 4px 4px;
}

.preview-vertical-day-name {
    padding: 0.35rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    background: #f9fafb;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-vertical-column {
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.preview-vertical-column:last-child {
    border-right: none;
}

.preview-vertical-lines {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 0;
    flex: 1;
}

.preview-vertical-line {
    height: 0.55em;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
}

/* Menu preview */
.preview-menu-week {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.preview-menu-header-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px 4px 0 0;
    background: #f3f4f6;
}

.preview-menu-day-header,
.preview-menu-meal-header {
    padding: 0.4rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border-right: 1px solid var(--border-color);
    color: #1f2937;
}

.preview-menu-meal-header {
    border-right: none;
}

.preview-menu-day-row {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 0;
    border: 1px solid var(--border-color);
    border-top: none;
}

.preview-menu-day-row:last-child {
    border-radius: 0 0 4px 4px;
}

.preview-menu-day-name {
    padding: 0.35rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    background: #f9fafb;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-menu-content {
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.preview-menu-content:last-child {
    border-right: none;
}

.preview-menu-lines {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 0;
    flex: 1;
}

.preview-menu-line {
    height: 0.55em;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
}

/* Activity preview */
.preview-activity-week {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 0;
}

.preview-activity-header-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px 4px 0 0;
    background: #f3f4f6;
}

.preview-activity-day-header {
    padding: 0.4rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
    border-right: 1px solid var(--border-color);
    color: #1f2937;
}

.preview-activity-column-header {
    padding: 0.4rem 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: left;
    border-right: 1px solid var(--border-color);
    color: #1f2937;
}

.preview-activity-column-header:last-child {
    border-right: none;
}

.preview-activity-day-row {
    display: grid;
    grid-template-columns: 50px 1fr 1fr 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border-color);
    border-top: none;
}

.preview-activity-day-row:last-child {
    border-radius: 0 0 4px 4px;
}

.preview-activity-day-name {
    padding: 0.35rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-right: 1px solid var(--border-color);
    background: #f9fafb;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-activity-column {
    padding: 0.25rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.preview-activity-column:last-child {
    border-right: none;
}

.preview-activity-lines {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-height: 0;
    flex: 1;
}

.preview-activity-line {
    height: 0.55em;
    border-bottom: 1px solid #e5e7eb;
    width: 100%;
}

/* Template options */
.template-options {
    width: 100%;
    margin: 0 0 0.75rem 0;
    padding: 0.6rem;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
}

.checkbox-label:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.select-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.select-label label {
    font-weight: 500;
    white-space: nowrap;
}

.year-select {
    flex: 1;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 150px;
}

.year-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Buttons */
.btn {
    width: 100%;
    margin-top: 1rem;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none !important;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
    text-decoration: none;
    margin: 0;
    flex-shrink: 0;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    box-shadow: none;
}

.btn:focus:not(:focus-visible) {
    outline: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-print {
    background: var(--primary-color);
    color: white;
    border: none !important;
}

.btn-print:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    border: none !important;
}


.btn:active {
    transform: translateY(0);
    border: none !important;
    box-shadow: none;
}

.btn-icon {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
    flex-shrink: 0;
    color: inherit;
    vertical-align: middle;
    display: inline-block;
    margin: 0;
    padding: 0;
}

/* Print container - skjul visuelt men synlig for PDF-generering */
#print-container {
    position: absolute;
    left: -9999px;
    visibility: hidden;
    width: 210mm;
    background: white;
}

#print-container[data-landscape] {
    width: 297mm;
}

/* Print styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        max-width: 100%;
    }

    header,
    .btn,
    .template-card:not(.print-active) {
        display: none !important;
    }

    .template-card.print-active {
        box-shadow: none;
        border: none;
        page-break-after: always;
    }

    .print-template {
        padding: 2rem;
    }

    .print-template h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
        text-align: center;
    }
}

/* Monthly template print */
.monthly-template {
    width: 100%;
}

.monthly-template h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.monthly-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.monthly-calendar .day-header {
    font-weight: 600;
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.monthly-calendar .day {
    aspect-ratio: 1;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    min-height: 80px;
}

.monthly-calendar .day-number {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* Horizontal week template print */
.horizontal-template {
    width: 100%;
}

.horizontal-template h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.horizontal-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
}

.horizontal-week .day {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    min-height: 400px;
}

.horizontal-week .day-header {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    text-align: center;
    font-size: 1rem;
}

/* Vertical week template print */
.vertical-template {
    width: 100%;
}

.vertical-template h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
}

.vertical-week {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.vertical-week .day {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    min-height: 150px;
}

.vertical-week .day-header {
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    header {
        margin-bottom: 3rem;
    }

    header h1 {
        font-size: 2.25rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        display: flex;
        flex-direction: column;
    }
    
    .template-card {
        width: 100%;
        min-height: 550px;
    }

    .template-preview {
        padding: 1.25rem 1rem;
    }

    .btn {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        padding: 12px 24px;
    }
    
    .preview-day-header {
        font-size: 0.55rem;
        padding: 0.12rem;
    }
    
    .preview-timetable-time-header,
    .preview-timetable-day-header {
        font-size: 0.62rem;
        padding: 0.32rem 0.2rem;
    }
    
    .preview-timetable-time-cell,
    .preview-timetable-cell {
        font-size: 0.6rem;
        padding: 0.25rem 0.18rem;
    }
    
    .preview-timetable-row {
        min-height: 36px;
    }
    
    .preview-activity-line {
        height: 0.4em;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.5rem 0.75rem;
    }

    header {
        margin-bottom: 2.5rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .template-preview {
        padding: 1rem 0.75rem;
    }
    
    .template-card {
        min-height: 500px;
    }

    .template-preview h3 {
        font-size: 1.15rem;
    }
    
    .template-icon-wrapper {
        width: 48px;
        height: 48px;
        margin-bottom: 0.75rem;
    }
    
    .template-icon {
        width: 24px;
        height: 24px;
    }
    
    .template-description {
        font-size: 0.8rem;
    }
        
    .preview-day {
        padding: 0.2rem;
    }
    
    .preview-day-header {
        font-size: 0.5rem;
        padding: 0.1rem;
    }
    
    .preview-timetable-time-header,
    .preview-timetable-day-header {
        font-size: 0.55rem;
        padding: 0.28rem 0.18rem;
    }
    
    .preview-timetable-time-cell,
    .preview-timetable-cell {
        font-size: 0.55rem;
        padding: 0.22rem 0.16rem;
    }
    
    .preview-timetable-row {
        min-height: 32px;
    }
    
    .preview-activity-line {
        height: 0.35em;
    }
    
    .preview-month-day {
        padding: 0.12rem;
    }
    
    .preview-day-num {
        font-size: 0.55rem;
    }
    
    .preview-month-line {
        height: 0.3em;
    }

    .template-options {
        padding: 0.5rem;
    }

    .checkbox-label {
        font-size: 0.8rem;
    }

    .select-label {
        font-size: 0.8rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .year-select {
        width: 100%;
        min-width: auto;
        font-size: 0.8rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 12px 20px;
        border-radius: 8px;
    }

    .btn-icon {
        width: 16px;
        height: 16px;
    }
}

/* Footer */
.footer {
    margin-top: 4rem;
    padding: 2rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.faq-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.privacy-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #e5e7eb;
    border-radius: var(--radius);
}

.privacy-section h2 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.privacy-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.privacy-section a {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

.footer p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.footer-copy {
    font-size: 0.85rem;
    margin-top: 1.5rem;
    font-weight: 500;
}

.footer-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2d2d2d;
}

.footer-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.footer-content strong {
    font-weight: 600;
    color: #8b7fc8;
}

.footer-keywords {
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    padding: 1rem 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 1rem;
}

.footer-copy {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e0e0e0;
    font-size: 0.9rem;
}
