/* Custom CSS for Digital Signage application */

/* General styling */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000;
    color: #fff;
}

/* Hide overflow only on display page, not admin pages */
body.display-page {
    overflow: hidden;
}

/* Display page */
.display-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.media-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Media styling */
.media-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: none;
    opacity: 0;
    transition-property: opacity, transform;
    transition-duration: var(--transition-duration, 1s);
    transition-timing-function: var(--transition-timing, ease);
}

.media-item img, .media-item video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.media-item iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.media-item.active {
    display: flex;
    opacity: 1;
    z-index: 10;
    align-items: center;
    justify-content: center;
}

.media-item.fade-out {
    opacity: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Transition effects */
.transition-fade .media-item.active {
    opacity: 1;
}

.transition-slide-left .media-item.incoming {
    transform: translateX(100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.transition-slide-left .media-item.active {
    transform: translateX(0);
}

.transition-slide-left .media-item.outgoing {
    transform: translateX(-100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.transition-slide-right .media-item.incoming {
    transform: translateX(-100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.transition-slide-right .media-item.active {
    transform: translateX(0);
}

.transition-slide-right .media-item.outgoing {
    transform: translateX(100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.transition-zoom-in .media-item.incoming {
    transform: scale(0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.transition-zoom-in .media-item.active {
    transform: scale(1);
    opacity: 1;
}

.transition-zoom-out .media-item.incoming {
    transform: scale(1.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.transition-zoom-out .media-item.active {
    transform: scale(1);
    opacity: 1;
}

/* News ticker */
.ticker-container {
    position: absolute;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: rgba(34, 34, 34, 0.9);
    display: flex;
    align-items: center;
    overflow: hidden;
    z-index: 100;
}

.ticker-top {
    top: 0;
    border-bottom: 1px solid #444;
}

.ticker-bottom {
    bottom: 0;
    border-top: 1px solid #444;
}

.ticker-logo {
    height: 50px;
    margin: 0 15px;
    cursor: pointer;
}

.ticker-clock {
    min-width: 100px;
    text-align: center;
    font-size: 1.2rem;
    margin: 0 15px;
    cursor: pointer;
}

.ticker-content {
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
}

.ticker-scrolling {
    display: inline-block;
    animation: ticker-scroll var(--ticker-speed, 300s) linear infinite;
    padding-left: 100%;
    white-space: nowrap;
}

.ticker-item {
    display: inline-block;
    margin-right: 30px;
}

@keyframes ticker-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* Overlay */
.overlay-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    pointer-events: none;
}

/* Admin panel */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-title {
    margin: 0;
}

.admin-nav {
    display: flex;
    gap: 10px;
}

.info-box {
    background-color: var(--bs-dark);
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 20px;
}

.preview-box {
    background-color: var(--bs-dark);
    border-radius: 5px;
    padding: 15px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-box img, .preview-box video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Form styling */
.form-section {
    margin-bottom: 30px;
}

.card-dashboard {
    margin-bottom: 20px;
}

/* News item styling */
.news-item {
    background-color: var(--bs-dark);
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 10px;
}

/* Color picker */
.color-preview {
    display: inline-block;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    border: 1px solid #444;
    vertical-align: middle;
    margin-right: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .admin-nav {
        margin-top: 10px;
    }
}

/* User guide styling */
.guide-section {
    margin-bottom: 30px;
}

.guide-section h3 {
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.guide-section ul {
    list-style-type: circle;
    padding-left: 20px;
}

.guide-section code {
    background-color: #333;
    padding: 2px 5px;
    border-radius: 3px;
}

/* Print-friendly styling */
@media print {
    .guide-container {
        background-color: white;
        color: black;
    }
    
    .guide-section h3 {
        border-bottom: 1px solid #999;
    }
    
    .guide-section code {
        background-color: #eee;
        border: 1px solid #ddd;
    }
    
    .admin-nav, .admin-header {
        display: none;
    }
}
