/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 24px;
    color: #2c3e50;
    background: #f0f4f8;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* ===== SCREENS ===== */
.screen {
    display: none;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ===== LOGIN ===== */
.login-box {
    margin: auto;
    text-align: center;
    padding: 40px;
}

.login-title {
    font-size: 2.5rem;
    color: #e74c8b;
    margin-bottom: 30px;
}

.login-input {
    display: block;
    width: 280px;
    margin: 0 auto 20px;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 12px;
    text-align: center;
    outline: none;
}

.login-input:focus {
    border-color: #e74c8b;
}

.login-btn {
    display: block;
    width: 280px;
    margin: 0 auto;
    padding: 15px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #e74c8b, #ff6b9d);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
}

.login-btn:active {
    transform: scale(0.97);
}

.login-error {
    margin-top: 15px;
    color: #e74c3c;
    font-size: 0.9rem;
}

/* ===== HOME SCREEN ===== */
#screen-home {
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.home-title {
    font-size: 52px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 50px;
    text-align: center;
}

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    max-width: 800px;
    flex: 1;
    max-height: 500px;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 50px 40px;
    border: none;
    border-radius: 24px;
    font-size: 48px;
    flex: 1;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.home-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.home-btn-photos {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.home-btn-family {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.home-btn-icon {
    font-size: 72px;
    line-height: 1;
}

.home-btn-label {
    line-height: 1;
}

/* ===== SCREEN HEADER ===== */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    z-index: 10;
}

.screen-title {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
}

.back-btn {
    background: #e8ecf1;
    border: none;
    border-radius: 16px;
    padding: 14px 28px;
    font-size: 24px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.back-btn:active {
    background: #d1d8e0;
}

.fullscreen-btn {
    background: #667eea;
    border: none;
    border-radius: 16px;
    padding: 14px 24px;
    font-size: 20px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.fullscreen-btn:active {
    background: #5a6fd6;
}

/* ===== PHOTOS VIEWER ===== */
.photos-container {
    flex: 1;
    position: relative;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.photos-viewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 0;
}

.photo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    animation: photoFadeIn 0.8s ease forwards;
}

/* Ken Burns efekt pre slideshow */
.photo-img.ken-burns {
    animation: photoFadeIn 0.8s ease forwards;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes photoFadeIn {
    from { opacity: 0; transform: scale(1.02); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes kenBurns {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.15) translate(-2%, -1%); }
}

.photo-counter {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 20px;
    pointer-events: none;
    z-index: 15;
}

.photo-message {
    color: white;
    font-size: 28px;
    text-align: center;
    padding: 40px;
}

.photo-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.7);
    flex-shrink: 0;
    z-index: 20;
}

.photo-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 16px;
    padding: 16px 32px;
    font-size: 24px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}

.photo-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.photo-btn-play {
    background: #667eea;
    padding: 16px 40px;
}

.photo-btn-play:active {
    background: #5a6fd6;
}

.photo-btn:disabled {
    opacity: 0.3;
}

/* Slideshow mód - skrytie ovládacích prvkov */
.slideshow-hidden {
    opacity: 0 !important;
    pointer-events: none;
    transition: opacity 0.8s ease;
}

.photo-controls,
#screen-photos .screen-header {
    transition: opacity 0.8s ease;
    opacity: 1;
}

/* ===== FAMILY / NAMEDAYS ===== */
.family-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.nameday-today {
    background: linear-gradient(135deg, #ffecd2, #fcb69f);
    border-radius: 20px;
    padding: 28px 32px;
    margin-bottom: 24px;
    text-align: center;
}

.nameday-today-label {
    font-size: 22px;
    color: #8b5e34;
    margin-bottom: 8px;
}

.nameday-today-name {
    font-size: 38px;
    font-weight: 700;
    color: #6b3a1f;
}

.family-section-title {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    margin: 24px 0 16px;
}

.family-events {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-card {
    background: white;
    border-radius: 20px;
    padding: 24px 28px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 20px;
}

.event-card.highlight {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.event-icon {
    font-size: 44px;
    flex-shrink: 0;
    line-height: 1;
}

.event-info {
    flex: 1;
}

.event-name {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
}

.event-detail {
    font-size: 22px;
    color: #636e72;
    margin-top: 4px;
}

.event-days {
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
    text-align: right;
    white-space: nowrap;
    flex-shrink: 0;
}

.event-days.today {
    font-size: 24px;
    color: #e17055;
}

/* ===== LANDSCAPE TABLET TWEAKS ===== */
@media (min-width: 768px) and (orientation: landscape) {
    .home-buttons {
        flex-direction: row;
    }

    .home-btn {
        flex: 1;
        flex-direction: column;
        padding: 60px 30px;
    }

    .home-btn-icon {
        font-size: 72px;
    }
}

/* ===== PHONE ===== */
@media (max-width: 768px) {
    .btn-text {
        display: none;
    }
}

/* ===== SMALL PHONE FALLBACK ===== */
@media (max-width: 480px) {
    html, body {
        font-size: 18px;
    }

    .home-title {
        font-size: 36px;
        margin-bottom: 30px;
    }

    .home-btn {
        padding: 28px 20px;
        font-size: 30px;
    }

    .home-btn-icon {
        font-size: 40px;
    }
}
