* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
}

.page {
    display: none;
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

.page.active {
    display: flex;
}

/* Home Page Styles */
#home-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    justify-content: center;
    align-items: center;
    color: white;
}

.home-container {
    text-align: center;
    padding: 2rem;
    max-width: 90%;
}

.home-container h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.home-container p {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.start-btn {
    padding: clamp(1rem, 3vw, 1.5rem) clamp(2rem, 5vw, 3rem);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    background: white;
    color: #667eea;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.start-btn:active {
    transform: scale(0.98);
}

/* Poster Page Styles - Gallery */
#poster-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    color: white;
    overflow: hidden;
    min-height: 100vh;
}

.gallery-container {
    width: 100%;
    height: 100%;
    position: relative;
    perspective: 1000px;
}

.gallery-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.85) rotateY(15deg) translateZ(-100px);
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), 
                transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                display 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
    pointer-events: none;
    will-change: transform, opacity;
    z-index: 0;
}

.gallery-slide.active {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    transform: scale(1) rotateY(0deg) translateZ(0);
    z-index: 10;
    pointer-events: auto;
}

.gallery-slide.prev {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transform: scale(0.75) rotateY(-25deg) translateX(-40%) translateZ(-150px);
    z-index: -1;
    filter: blur(2px);
    pointer-events: none !important;
}

.gallery-slide.next {
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transform: scale(0.75) rotateY(25deg) translateX(40%) translateZ(-150px);
    z-index: -1;
    filter: blur(2px);
    pointer-events: none !important;
}

.slide-content {
    width: 100%;
    height: 100%;
    padding: 3rem;
    position: relative;
    z-index: 1;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.5rem;
    width: 100%;
    height: 100%;
    align-items: center;
}

.grid-spacer {
    grid-column: 1 / span 2;
}

.grid-main {
    grid-column: 3 / span 8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    width: 100%;
}

.grid-qr {
    grid-column: 11 / span 2;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding-top: 64px;
}

.qr-block {
    position: static;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.35);
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
}

.qr-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    background: #fff;
    padding: 12px;
    border-radius: 12px;
}

.qr-url {
    font-size: 12px;
    max-width: 100%;
    word-break: break-all;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .grid-spacer {
        display: none;
    }

    .grid-main {
        grid-column: 1 / -1;
    }

    .grid-qr {
        grid-column: 1 / -1;
        padding-top: 0;
        order: 2;
    }

    .qr-block {
        padding: 12px;
        max-width: 260px;
    }

    .qr-image {
        padding: 8px;
    }
}

.top-person-slide {
    padding: 3rem;
}

.top-person-card {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
    align-items: center;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    width: min(1100px, 95%);
}

.top-person-avatar-wrap {
    width: 260px;
    height: 260px;
    border-radius: 20px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
}

.top-person-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.top-person-text .person-fio {
    font-size: clamp(2.2rem, 6vw, 3.6rem);
    font-weight: 900;
    margin-bottom: 0.6rem;
}

.top-person-text .person-achievement {
    font-size: clamp(1.2rem, 3vw, 1.7rem);
    font-weight: 700;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.top-person-text .person-info {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.top-people-slide {
    padding: 3rem;
    align-items: stretch;
}

.top-people-header {
    text-align: center;
    margin-bottom: 2rem;
}

.top-people-title {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.top-people-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.4rem;
}

.top-people-date {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: rgba(255, 255, 255, 0.85);
}

.top-people-list {
    width: min(800px, 90%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.top-people-row {
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    font-weight: 600;
    text-align: center;
}

/* Image Block with animated background - Modern Poster Style */
.image-block {
    width: 100%;
    height: clamp(400px, 50vh, 600px);
    border-radius: 30px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: backgroundShift 10s ease-in-out infinite;
    background-size: 200% 200%;
}

.animated-bg {
    width: 100%;
    height: 100%;
    position: relative;
    animation: backgroundShift 10s ease-in-out infinite, subtlePulse 6s ease-in-out infinite;
}

.animated-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: shimmer 8s ease-in-out infinite;
}

.animated-bg::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes backgroundShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

@keyframes subtlePulse {
    0%, 100% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
}

@keyframes shimmer {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-100%);
    }
    50% {
        opacity: 0.6;
        transform: translateX(100%);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Text Block - Modern Poster Style */
.text-block {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
    width: 100%;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.3);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    color: white;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.person-fio {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 255, 255, 0.3);
    animation: fadeInUp 0.8s ease;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.person-achievement {
    font-size: clamp(1.4rem, 3.5vw, 2.5rem);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 255, 255, 0.2);
    padding: 1.5rem 3rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    border-radius: 20px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: fadeInUp 0.8s ease 0.2s both;
    display: inline-block;
}

.person-info {
    font-size: clamp(1.1rem, 2.8vw, 1.8rem);
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease 0.4s both;
    font-weight: 400;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.6);
    }
}

/* Responsive layout adjustments */
@media (orientation: landscape) {
    .slide-content {
        flex-direction: row;
        gap: 4rem;
        max-width: 1400px;
        padding: 4rem;
    }
    
    .image-block {
        width: 50%;
        height: 100%;
        flex-shrink: 0;
        max-height: 700px;
    }
    
    .text-block {
        text-align: left;
        width: 50%;
        flex: 1;
        padding: 3rem;
    }
}

@media (orientation: portrait) {
    .slide-content {
        flex-direction: column;
        gap: 2.5rem;
        padding: 2rem;
    }
    
    .image-block {
        width: 100%;
        height: clamp(300px, 45vh, 500px);
    }
    
    .text-block {
        width: 100%;
        padding: 2rem;
    }
}

/* Slide transition effects */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9) rotateY(20deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1) rotateY(0deg);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1) rotateY(0deg);
    }
    to {
        opacity: 0;
        transform: translateX(-100%) scale(0.9) rotateY(-20deg);
    }
}

/* Responsive adjustments */
@media (orientation: landscape) {
    .home-container,
    .poster-content {
        max-width: 80%;
    }
}

@media (orientation: portrait) {
    .home-container,
    .poster-content {
        max-width: 95%;
    }
}

/* Fullscreen styles */
:fullscreen {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

:-webkit-full-screen {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

:-moz-full-screen {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

:-ms-fullscreen {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Стили для расписания классов */
.schedule-slide {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
    max-width: 1400px;
    width: 100%;
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.schedule-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    opacity: 0.3;
    z-index: 0;
}

.schedule-slide > * {
    position: relative;
    z-index: 1;
}

.schedule-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.class-name {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    color: white;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.7), 0 0 30px rgba(255, 255, 255, 0.2);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.day-name {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.schedule-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
}

.schedule-list.schedule-three-days {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
    align-items: start;
    max-width: 1300px;
}

.day-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
    min-height: 200px;
}

.day-column-title {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.day-label {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 800;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.day-week {
    font-size: clamp(0.95rem, 2.4vw, 1.2rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.day-column-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.schedule-empty {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px dashed rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.schedule-lesson {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease both;
}

.schedule-lesson:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.lesson-number {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    min-width: 60px;
    text-align: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 0.5rem;
}

.lesson-time {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    min-width: 120px;
}

.lesson-subject {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    flex: 1;
    text-align: left;
}
