/* ==========================================================================
   Cinematic Homepage Style for MW Dashboard 
   ========================================================================== */

body {
  -webkit-user-select: none; /* Safari */
  -moz-user-select: none; /* Firefox */
  -ms-user-select: none; /* Internet Explorer/Edge */
  user-select: none; /* Standard syntax */
}
:root {
    --text-color: #ffffff;
    --button-bg-color: rgba(0, 0, 0, 0.4);
    --button-border-color: rgba(255, 255, 255, 0.5);
    --button-hover-bg: rgba(255, 255, 255, 0.15);
    --transition-speed: 0.5s ease;
    --brand-orange: #FF8C00;
}

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

html, body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Poppins', sans-serif;
    background-color: #000000;
}

/* --- Preloader Styles --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.75s ease, visibility 0.75s;
    visibility: visible;
    opacity: 1;
}

#preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Main Page Styles --- */
#video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* The background image is now handled by the ::before pseudo-element for lazy loading */
}

/* New pseudo-element for the lazy-loaded background */
#video-background::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/icons/MWDahboard.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    opacity: 0; /* Initially hidden */
    transition: opacity 0.75s ease-in-out; /* Smooth fade-in effect */
}

/* This class will be added by JavaScript once the image has loaded */
#video-background.image-loaded::before {
    opacity: 1; /* Fade the image in */
}


#brand-container {
    position: absolute;
    top: 2.5rem; /* Position from top */
    left: 2.5rem;  /* Position from left */
    transform: none; /* Removed centering transform */
    z-index: 5;
    pointer-events: none;
}

.brand-title { 
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align items to the left */
    gap: 0.25rem; /* Reduced gap */
    text-align: left; /* Align text to the left */
} 

.brand-logo {
    height: 100px; /* Made smaller */
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.brand-text {
    font-size: 2rem; /* Made smaller */
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

.brand-tagline {
  font-size: 0.9rem; /* Made smaller */
  font-weight: 300;
  color: white;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
  max-width: 350px; /* Constrain width */
  line-height: 1.5; 
  margin-top: 0.5rem;
  pointer-events: auto;
  position: relative;
  z-index: 1;
  background-blend-mode: overlay;
}

.brand-tagline::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: linear-gradient(to right, white, orange);
  opacity: 0.1;
}

.brand-mw { color: var(--text-color); }
.brand-dashboard { color: var(--brand-orange); }

/* --- RECONSTRUCTED Button Navigation Styles --- */
#main-nav-buttons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
}

.nav-button {
    position: absolute;
    display: flex;
    align-items: center;
    width: auto; /* Let the button size to its content */
    white-space: nowrap; /* Prevent text wrapping */
    color: var(--text-color);
    background-color: rgba(0, 0, 0, 0.25); /* Slightly darker for better contrast */
    
    /* Frosted glass effect for readability */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    border: none;
    border-radius: 8px; /* Slightly more rounded */
    padding: 10px 14px; /* Made slightly larger */
    text-decoration: none;
    font-weight: 300;
    font-size: 0.9rem; /* Made slightly larger */
    text-align: left;
    transition: background-color 0.4s ease;
    pointer-events: auto;
    
    /* Create a gradient border effect using a pseudo-element */
    z-index: 1;
}

/* The gradient border pseudo-element */
.nav-button::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px; /* Match the new border-radius */
    padding: 2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.5), rgba(255, 140, 0, 0.8), rgba(255, 255, 255, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    z-index: -1;
    opacity: 0.5;
    transition: opacity 0.4s ease;
}

/* Static Hover Effect - No motion */
.nav-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

.nav-button:hover::before {
    opacity: 1;
}

/* Icon Styles */
.nav-icon {
    width: 18px; /* Made slightly larger */
    height: 18px; /* Made slightly larger */
    margin-right: 12px; /* Adjusted margin */
    stroke: var(--brand-orange);
}

/* --- Individual Button Positioning --- */

/* Designs -> Top-right screen */
.nav-button:nth-child(1) {
    top: 32%;
    right: 25%;
}

/* Additional Services -> Middle-left screen */
.nav-button:nth-child(2) {
    top: 48%;
    left: 27%;
}

/* Custom Orders -> Bottom-left screen */
.nav-button:nth-child(3) {
    top: 70%;
    left: 16%;
}

/* Templates Shop -> Top-middle screen */
.nav-button:nth-child(4) {
    top: 21%;
    left: 51%;
    transform: translateX(-50%);
}

/* Ask AI Assistant -> Far-left screen */
.nav-button:nth-child(5) {
    top: 41%;
    left: 6%;
}

/* Design Perspective -> Bottom-middle screen */
.nav-button:nth-child(6) {
    top: 78%;
    left: 45%;
}

/* About -> Bottom-right screen */
.nav-button:nth-child(7) {
    top: 65%;
    right: 8%;
}


/* --- Footer Styles --- */
#page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 1rem 2.5rem;
    z-index: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.copyright-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

#external-platforms {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.social-item {
    position: relative;
    display: flex;
    justify-content: center;
}

.social-item .social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 34px;
    height: 34px;
    background-color: #D1D1D1;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-item .social-link img {
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.social-item:hover .social-link {
    transform: scale(1.1) translateY(-2px);
    background-color: #ffffff;
}

.social-item span {
    position: absolute;
    bottom: 130%;
    background-color: var(--brand-orange);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.social-item:hover span {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* --- Mobile --- */
@media (max-width: 768px) { 
    
    #brand-container {
        top: 1.5rem;
        left: 1.5rem;
    }

    .brand-logo {
        height: 80px; /* Even smaller for mobile */
    }

    .brand-text { 
        font-size: 1.5rem; /* Even smaller for mobile */
    }

    .brand-tagline {
        font-size: 0.8rem; /* Even smaller for mobile */
        max-width: 280px;
    }

    /* --- Mobile Button Layout --- */
    #main-nav-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        top: 50%;
        right: 1.5rem;
        transform: translateY(-50%);
        width: auto;
        height: auto;
        left: auto;
    }
    
    /* Reset button styles for mobile layout */
    .nav-button {
        position: static; /* Let buttons flow in the flex container */
        /* Unset absolute positioning properties */
        top: unset;
        left: unset;
        right: unset;
        bottom: unset;
        transform: none;
    }

    #page-footer {
        padding: 1rem;
    }
    .footer-content {
        flex-direction: column;
        gap: 1rem;
    }
    #external-platforms {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* This rule targets common class names used by browser extensions to hide their download buttons */
.download-button,
.video-download-btn,
.video-controls-overlay,
.video-extension-button {
    display: none !important;
}
