html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--bs-focus-ring-color);
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

@media (max-width: 767.98px) {
    .user-profile-dropdown {
        position: fixed !important;
        top: 56px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important; /* defend against any leftover max-width */
        min-width: 100% !important;
        max-height: calc(100vh - 56px) !important;
        height: calc(100vh - 56px) !important;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        z-index: 1050 !important;
        transform: translateY(10px);
        opacity: 0;
        transform-origin: top center;
        transition: transform 0.18s ease-out, opacity 0.18s ease-out;
    }

    .dropdown-menu.user-profile-dropdown.show {
        transform: translateY(0);
        opacity: 1;
    }

    .user-profile-dropdown .dropdown-item {
        padding: 0.9rem 1.25rem;
        font-size: 1.05rem;
    }

    .user-profile-dropdown .dropdown-item,
    .btn-primary {
        min-height: 40px;
    }
}

/* Desktop / tablet: keep compact dropdown card */
@media (min-width: 768px) {
    .user-profile-dropdown {
        min-width: 280px;
        max-width: 320px;
        border-radius: 0.5rem;
    }
}

/* Enhancements for all screen sizes */
.user-profile-dropdown .dropdown-item i {
    font-size: 1.2rem;
    width: 1.75rem;
    text-align: center;
}

.user-profile-dropdown {
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.form-switch .form-check-input:checked {
    background-color: var(--bs-green);
    border-color: var(--bs-green);
}


/* Watch hover UX to match phone */
.watch-container {
    position: relative;
}


    .watch-container::before {
        content: ""; 
        position: absolute; 
        top: 10%; 
        left: 10%;
        width: 80%;
        height: 80%;
        background-color: transparent;
        border-radius: 16px; 
        z-index: 0; 
        pointer-events: none;
        transition: background-color .2s ease;
    }

    .watch-container:hover::before {
        background-color: var(--bs-blue); 
    }

.watch-image {
    z-index: 1;
    pointer-events: none; 
    transition: opacity .2s ease-in-out;
}

.watch-frame {
    z-index: 2;
    pointer-events: none; 
}

.watch-buttons {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none; 
    flex-direction: column;
    gap: 10px;
}

.watch-container:hover .watch-image {
    opacity: 0.5;
}

.watch-container:hover .watch-buttons {
    display: flex;
}


/* Phone preview hover overlay confined to the screen area */
.phone-container {
    position: relative;
    border-radius: 12px;
}

    .phone-container::before {
        content: "";
        position: absolute;
        top: 10%;
        left: 5%;
        width: 90%;
        height: 80%; 
        background-color: transparent;
        border-radius: 18px; 
        z-index: 0; 
        pointer-events: none;
        transition: background-color .2s ease;
    }

    .phone-container:hover::before {
        background-color: var(--bs-blue); 
    }

.phone-image {
    position: absolute;
    z-index: 1;
    pointer-events: none; 
}

.phone-frame {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.phone-buttons {
    position: absolute;
    z-index: 3;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    gap: 10px;
}

.phone-container:hover .phone-image {
    opacity: 0.5;
}

.phone-container:hover .phone-buttons {
    display: flex;
}

/* Base modal iframe style */
.modal-iframe-default {
    width: 100%;
    aspect-ratio: 4 / 3;
    margin: 0;
    border: none;
}

/* Fullscreen variant from JS */
.modal-iframe-fullscreen {
    width: 100%;
    height: 100%;
    margin: 0;
    border: none;
}

/* Ensure modal vertically centers on all devices */
.modal-dialog {
    margin: 1.75rem auto;
}

/* ---- FULLSCREEN MODAL OVERRIDES ---- */
.modal-dialog.modal-fullscreen {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    align-items: stretch; /* ignore flex centering overrides */
}

/* Phones */
@media (max-width: 576px) {
    /* On narrow devices: make the modal taller and nicely centered */
    .modal-dialog {
        max-width: 100%;
        margin: 0; /* let it take full viewport width */
        height: 100%; /* let inner content control vertical centering */
        display: flex;
        align-items: center; /* vertical center */
    }

    /* But NOT for fullscreen dialogs */
    .modal-dialog.modal-fullscreen {
        max-width: 100%;
        margin: 0;
        height: 100%;
        display: block;       /* cancel flex centering */
        align-items: stretch;
    }

    .modal-content {
        height: 90vh; /* 90% of viewport height => ~half taller than now */
    }

    .modal-dialog.modal-fullscreen .modal-content {
        height: 100vh; /* true fullscreen */
        border-radius: 0;
    }

    .modal-body .modal-iframe-default {
        /* Taller than 4:3 on phones */
        height: 65vh; /* tweak this until it looks right */
        width: 100%;
        aspect-ratio: auto; /* disable 4:3 on narrow screens */
    }
}

/* Midrange devices: e.g. large phones / small tablets */
@media (min-width: 577px) and (max-width: 991.98px) {
    .modal-dialog {
        max-width: 95%;
        margin: 0 auto;
        height: 100%;
        display: flex;
        align-items: center; /* vertical center */
    }

    /* But NOT for fullscreen dialogs */
    .modal-dialog.modal-fullscreen {
        max-width: 100%;
        margin: 0;
        height: 100%;
        display: block;
        align-items: stretch;
    }

    .modal-content {
        height: 80vh; /* taller than desktop, a bit shorter than phone */
    }

    .modal-dialog.modal-fullscreen .modal-content {
        height: 100vh;
        border-radius: 0;
    }

    .modal-body .modal-iframe-default {
        height: 70vh;   /* make iframe taller on midrange */
        width: 100%;
        aspect-ratio: auto; /* override 4:3 */
    }
}
