/* Fonts */
@font-face {
    font-family: Druk;
    src: url(../fonts/Druk\ Wide\ Cyr\ Medium.otf);
  }
  
/* Root Variables */
:root {
    --primary-color: #fff;
    --secondary-color: #000;
    --text-color: #fff;
    --spacing-unit: 1rem;
    --max-width: 1200px;
    --header-height: 80px;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.container {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-unit);
}

/* Language Switch */
.language-switch {
    position: fixed;
    top: var(--spacing-unit);
    right: var(--spacing-unit);
    z-index: 100;
    font-weight: 500;
}

.language-switch a {
    text-decoration: none;
    color: var(--primary-color);
    transition: opacity 0.3s ease;
}

.language-switch a:hover {
    opacity: 0.7;
}

/* Main Page Header */
.main-header {
    text-align: center;
    padding: 20vh 0 10vh;
}

.main-header h1 {
    font-size: 3rem;
    font-weight: 100;
    letter-spacing: 0.1em;
    margin-bottom: var(--spacing-unit);
    color: var(--primary-color);
    font-family: 'Druk';
}

/* Main Navigation */
.navigation-links {
    display: flex;
    justify-content: center;
    gap: calc(var(--spacing-unit) * 3);
    margin-bottom: calc(var(--spacing-unit) * 4);
}

.nav-link {
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    position: relative;
    padding: 5px 0;
}

.nav-link:after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-link:hover:after {
    transform: scaleX(1);
}

/* Menu */
.menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: calc(var(--spacing-unit) * 2) 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: calc(var(--spacing-unit) * 2);
    gap: calc(var(--spacing-unit) * 1);
}

.menu-left {
    display: flex;
    gap: calc(var(--spacing-unit) * 1);
    align-items: center;
}

.menu-right {
    color: var(--primary-color);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    gap: calc(var(--spacing-unit) * 1);
}

.menu-item {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    transition: opacity 0.3s ease;
}

.menu-item:hover {
    opacity: 0.7;
}

.menu-item.active {
    text-decoration: line-through;
}

/* About Section */
.main-about-section {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(var(--spacing-unit) * 4) 0;
    text-align: center;
}

.main-about-content {
    line-height: 1.6;
    font-size: 1.1rem;
    color: var(--primary-color);
    white-space: pre-line;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-unit);
    padding: var(--spacing-unit);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.thumbnail-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.video-thumbnail:hover img {
    filter: grayscale(100%) brightness(0.3);
    transform: scale(1.05);
}

.video-info {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    width: 90%;
}

.video-thumbnail:hover .video-info {
    opacity: 1;
}

.video-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.video-category {
    font-size: 0.9rem;
    opacity: 0.8;
}

.video-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

/* Video Player */
.video-player-container {
    width: 100%;
    max-width: var(--max-width);
    margin: calc(var(--spacing-unit) * 2) auto;
    background-color: var(--secondary-color);
    position: relative;
    padding-top: 56.25%;
}

.video-player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-color);
}

.video-description {
    max-width: 800px;
    margin: calc(var(--spacing-unit) * 3) auto;
    padding: 0 var(--spacing-unit);
    color: var(--primary-color);
}

.video-description h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.description-text {
    line-height: 1.6;
    font-size: 1rem;
    white-space: pre-line;
}

/* Video Controls */
video::-webkit-media-controls-panel {
    background-image: linear-gradient(transparent, transparent) !important;
}

video::-webkit-media-controls-timeline {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 0 10px;
}

video::-webkit-media-controls-current-time-display,
video::-webkit-media-controls-time-remaining-display {
    color: var(--primary-color);
}

/* YouTube Container */
.youtube-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--secondary-color);
}

.youtube-container iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Contact Section */

.commercial-info {
    margin-top: calc(var(--spacing-unit) * 3);
    padding-top: calc(var(--spacing-unit) * 3);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.commercial-info h2 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.commercial-info p {
    margin-bottom: 0.5rem;
}

.commercial-info a {
    color: var(--primary-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.commercial-info a:hover {
    opacity: 0.7;
}

/* Footer */
footer {
    margin-top: auto;
    padding: calc(var(--spacing-unit) * 2) var(--spacing-unit);
    text-align: center;
}

.social-links {
    margin-bottom: var(--spacing-unit);
}

.social-icon {
    display: inline-block;
    margin: 0 calc(var(--spacing-unit) / 2);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.social-icon:hover {
    opacity: 0.7;
}

.social-icon img {
    display: block;
    filter: invert(1);
}

.copyright {
    font-size: 0.9rem;
    color: var(--primary-color);
    opacity: 0.8;
}

/* Background Video */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

/* Dark overlay */
.background-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2; /* Above both video and image */
}

/* Video styles */
.background-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translateX(-50%) translateY(-50%);
    object-fit: cover;
    z-index: 1;
}

/* Image styles */
.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    display: none;
}

/* Media query for mobile devices */
@media (max-width: 768px), (pointer: coarse) {
    .background-video {
        display: none;
    }
    
    .background-image {
        display: block;
    }
}

/* 404 Page */
.error-page {
    display: flex;
    flex-direction: column;
}

.error-page .menu {
    flex-shrink: 0; /* Prevent menu from shrinking */
}

.error-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-unit);
}

/* Remove any margin-bottom from the menu in error page */
.error-page .menu {
    margin-bottom: 0;
}

/* Admin Panel Styles */
.admin-section {
    margin-bottom: calc(var(--spacing-unit) * 3);
}

.table-responsive {
    background-color: var(--secondary-color);
}

.thumbnail-preview {
    width: 120px;
    height: 67.5px; /* 16:9 aspect ratio */
    object-fit: cover;
    border-radius: 4px;
}

.drag-handle {
    cursor: move;
    color: rgba(255, 255, 255, 0.5);
    user-select: none;
    text-align: center;
}

.sortable-ghost {
    opacity: 0.5;
    background: rgba(255, 255, 255, 0.1);
}

/* Bootstrap Dark Theme Overrides */
.table-dark {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.05);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.form-control.bg-dark {
    border-color: rgba(255, 255, 255, 0.2);
}

.form-control.bg-dark:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--secondary-color);
}

.btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 255, 255, 0.8);
    color: var(--secondary-color);
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
}

#saveMessage.success {
    color: #28a745;
}

#saveMessage.error {
    color: #dc3545;
}

/* Form Control Sizes */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Admin Table Styles */
.table-dark th[data-column="key"] {
    width: 200px; /* Narrower key column */
}

.table-dark td {
    vertical-align: middle; /* Vertical alignment */
}

/* Floating Save Button */
.floating-save {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.floating-save:hover {
    transform: translateY(-2px);
}

.floating-save:disabled {
    transform: none;
    opacity: 0.7;
}

/* Top Save Button (alternative) */
.menu-save {
    margin-left: auto;
    margin-right: 1rem;
}

/* Form changes indicator */
.form-control.changed {
    border-color: var(--bs-primary) !important;
}

/* Save success animation */
@keyframes saveSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.save-success {
    animation: saveSuccess 0.3s ease;
}

/* Login Page Styles */
.login-page {
    display: flex;
    align-items: center;
    min-height: 100vh;
    background-color: var(--secondary-color);
}

.form-signin {
    max-width: 330px;
    width: 100%;
    padding: 1rem;
}

.login-input {
    background-color: var(--secondary-color) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary-color) !important;
    height: 60px !important;
    padding: 0 1rem !important;
    font-size: 1rem;
}

.login-input:focus {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.05);
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus,
.login-input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--primary-color) !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--secondary-color) inset !important;
    box-shadow: 0 0 0px 1000px var(--secondary-color) inset !important;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: var(--primary-color);
}

.login-button {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
    transition: all 0.3s ease;
    height: 60px;
    margin-top: 1rem;
}

.login-button:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--primary-color);
}

.error-message {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 4px;
    padding: 0.75rem 1rem;
}

/* About section */
.inner-about-section {
    max-width: 800px;
    margin: calc(var(--spacing-unit) * 4) auto;
    padding: 0 var(--spacing-unit);
    text-align: center;
}

.inner-about-content {
    line-height: 1.6;
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-color);
    white-space: pre-line;
}

.photos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.photo-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

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