/* BMS Style Guide Colors
Primary:
- Blue: #034ea2 (C 100 M 80 Y 0 K 0 / R 22 G 65 B 148)
- Yellow: #fdb913 (C 0 M 30 Y 100 K 0 / R 253 G 185 B 19)
- Green: #4caf45 (C 70 M 0 Y 100 K 5 / R 76 G 175 B 69)

Secondary/Neutral:
- Gray: #808285 (C 0 M 0 Y 0 K 60 / R 128 G 130 B 133)
- Olive: #6e6c55 (C 0 M 0 Y 30 K 70 / R 110 G 108 B 85)
- Slate: #48626f (C 30 M 0 Y 0 K 70 / R 72 G 98 B 111)
*/

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: #0a0a10;
    color: #e0e0e0;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* --- Animated Background --- */
.animated-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(ellipse at center, rgba(3, 78, 162, 0.1) 0%, rgba(10, 10, 16, 0) 70%);
}

.background-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    max-width: 700px;
    opacity: 0.03;
    z-index: -2;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
    filter: blur(35px);
    animation: float 15s infinite ease-in-out alternate;
}

/* Particle positions and animations */
.particle-1 { top: 15%; left: 10%; width: 500px; height: 500px; background-color: rgba(3, 78, 162, 0.15); animation-duration: 24s; }
.particle-2 { bottom: 5%; right: 10%; width: 450px; height: 450px; background-color: rgba(76, 175, 69, 0.1); animation-duration: 19s; animation-delay: -5s; }
.particle-3 { top: 50%; left: 25%; width: 300px; height: 300px; background-color: rgba(253, 185, 19, 0.1); animation-duration: 25s; animation-delay: -10s; }
.particle-4 { top: 5%; right: 20%; width: 350px; height: 350px; background-color: rgba(72, 98, 111, 0.12); animation-duration: 21s; animation-delay: -15s; }
.particle-5 { bottom: 20%; left: 45%; width: 280px; height: 280px; background-color: rgba(110, 108, 85, 0.1); animation-duration: 28s; animation-delay: -2s; }
.particle-6 { top: 75%; left: 65%; width: 220px; height: 220px; background-color: rgba(3, 78, 162, 0.08); animation-duration: 17s; animation-delay: -8s; }
.particle-7 { top: 30%; left: 80%; width: 180px; height: 180px; background-color: rgba(76, 175, 69, 0.07); animation-duration: 30s; animation-delay: -12s; }
.particle-8 { bottom: 40%; left: 5%; width: 200px; height: 200px; background-color: rgba(253, 185, 19, 0.08); animation-duration: 23s; animation-delay: -3s; }
.particle-9 { top: 60%; right: 5%; width: 250px; height: 250px; background-color: rgba(72, 98, 111, 0.09); animation-duration: 27s; animation-delay: -18s; }
.particle-10 { bottom: 15%; right: 40%; width: 150px; height: 150px; background-color: rgba(110, 108, 85, 0.06); animation-duration: 19s; animation-delay: -6s; }
.particle-11 { top: 5%; left: 50%; width: 100px; height: 100px; background-color: rgba(3, 78, 162, 0.05); animation-duration: 35s; animation-delay: -1s; }
.particle-12 { bottom: 50%; right: 25%; width: 120px; height: 120px; background-color: rgba(76, 175, 69, 0.05); animation-duration: 32s; animation-delay: -9s; }

@keyframes float {
    0% { transform: translate(0px, 0px) rotate(-2deg) scale(0.98); opacity: 0.5; }
    50% { transform: translate(25px, 45px) rotate(3deg) scale(1.05); opacity: 0.7; }
    100% { transform: translate(0px, 0px) rotate(-2deg) scale(0.98); opacity: 0.5; }
}

/* --- Header --- */
header {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.logo-container {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    width: 100%;
    height: auto;
    opacity: 0.9;
}

/* --- Main Display Container --- */
#display-container {
    max-width: 1600px;
    width: 90%;
    height: calc(100vh - 140px);
    margin: 70px auto 0 auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* --- Loading Animation --- */
#loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(10, 10, 16, 0.95);
    z-index: 100;
    opacity: 1;
    transition: opacity 0.8s ease 0.5s;
}

#loading-container.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: #034ea2;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Slide Templates & Transitions --- */
.slide-template-standard,
.slide-template-header,
.slide-template-announcement {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95) translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0s 0.7s;
}

.slide-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
    z-index: 1;
    transition: opacity 0.7s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1), visibility 0s 0s;
}

.slide-out {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.05) translateY(-20px);
    z-index: 0;
    transition: opacity 0.6s cubic-bezier(0.75, 0, 0.75, 0.2), transform 0.6s cubic-bezier(0.75, 0, 0.75, 0.2), visibility 0s 0.6s;
}

/* --- Product Slide (Standard Template) --- */
.slide-template-standard {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 30px 50px;
    gap: 40px;
}

#product-image-container {
    flex: 1 1 55%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#product-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    animation: productFloat 8s infinite ease-in-out alternate;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

@keyframes productFloat {
    from { transform: translateY(-10px) scale(1); }
    to { transform: translateY(10px) scale(1.01); }
}

#product-image:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

#product-details {
    flex: 1 1 45%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.slide-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    color: #fdb913;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    line-height: 1.2;
}

.product-code {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 25px;
    color: #a0a2a5;
    font-weight: 400;
}

#price-container {
    display: flex;
    align-items: baseline;
    background-color: rgba(76, 175, 69, 0.1);
    padding: 10px 20px;
    border-radius: 5px;
    border-left: 3px solid #4caf45;
}

.price-label {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 500;
    margin-right: 10px;
    color: #b2dfb4;
}

.price-value {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

/* --- Category Slide (Header Template) --- */
.slide-template-header {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    background: linear-gradient(rgba(10, 10, 16, 0.5), rgba(10, 10, 16, 0.8));
}

#category-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    margin-bottom: 30px;
    color: #e0e0e0;
}

#category-description {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    max-width: 900px;
    line-height: 1.5;
    color: #b0b0b0;
}

/* --- Announcement Slide --- */
.slide-template-announcement {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 50px;
    background-color: rgba(3, 78, 162, 0.85);
    border-radius: 15px;
    margin: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#announcement-title {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    color: #ffffff;
    margin-bottom: 30px;
}

#announcement-content {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    max-width: 900px;
    line-height: 1.6;
    color: #e0e0ff;
}

/* --- Navigation Controls - For Admin/Testing Only --- */
#slide-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 50;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

#slide-controls:hover {
    opacity: 1;
}

#slide-controls button,
#slide-controls .nav-button {
    padding: 10px 15px;
    background-color: #034ea2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
}

#admin-link {
    background-color: #fdb913;
    margin-left: 10px;
}

#admin-link:hover {
    background-color: #e5a812;
}

/* Full Screen Mode Styles */
body.fullscreen {
    overflow: hidden;
}

body.fullscreen #display-container {
    max-width: none;
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
}

body.fullscreen header {
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.fullscreen #slide-controls {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease, pointer-events 0s 0.5s;
}

/* Show controls only when deliberately hovering near bottom of screen */
body.fullscreen #display-container:hover #slide-controls {
    opacity: 0.7;
    pointer-events: all;
    transition: opacity 0.5s ease;
}

/* Add key for exiting fullscreen (ESC) */
body.fullscreen::after {
    content: "Press ESC to exit fullscreen";
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

body.fullscreen::after {
    animation: fadeOutAfter 3s forwards;
}

@keyframes fadeOutAfter {
    0% { opacity: 0.5; }
    80% { opacity: 0.5; }
    100% { opacity: 0; }
}

/* Media Queries */
@media (max-width: 1200px) {
    .slide-title {
        font-size: 3rem;
    }
    .price-value {
        font-size: 4rem;
    }
    #category-title {
        font-size: 5rem;
    }
}

@media (max-width: 900px) {
    .slide-template-standard {
        flex-direction: column;
    }
    #product-image-container,
    #product-details {
        width: 100%;
    }
    .slide-title {
        font-size: 2.5rem;
    }
    .price-value {
        font-size: 3.5rem;
    }
}

@media (max-width: 600px) {
    header {
        padding: 10px;
    }
    .logo-container {
        width: 80px;
        height: 80px;
    }
    #display-container {
        height: calc(100vh - 100px);
        padding: 20px;
    }
    .slide-template-standard {
        padding: 20px;
        flex-direction: column;
    }
    #product-image-container {
        width: 100%;
        margin-bottom: 20px;
    }
    #product-details {
        width: 100%;
        padding: 0;
    }
    .slide-title {
        font-size: 2rem;
    }
    .product-code {
        font-size: 1.2rem;
    }
    .price-label {
        font-size: 1.6rem;
    }
    .price-value {
        font-size: 3rem;
    }
    #category-slide,
    #announcement-slide {
        padding: 30px;
    }
    #category-title,
    #announcement-title {
        font-size: 3rem;
        margin-bottom: 20px;
    }
    #category-description,
    #announcement-content {
        font-size: 1.5rem;
    }
    @media (orientation: portrait) {
        #display-container {
            padding: 10px;
            height: calc(100vh - 80px);
        }
    }
}
