/**
 * CONSOLIDATED UI SHARED STYLES
 */

 /* Loading overlay styles */

 #loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
}

#loadingOverlay .spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 8px solid #f3f3f3;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Background images for auth pages */
.bg1 {
    background-image: url('/img/icetower.jpg');
    background-size: cover;
    background-position: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.bg2 {
    background-image: url('/img/cityscape.jpg');
    background-size: cover;
    background-position: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Logo container styling moved to _Layout.cshtml.css */

/* Structure and layout */
html {
    position: relative;
    min-height: 100%;
    overflow-x: hidden;
}

body {
    margin-bottom: 60px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.content {
    flex: 1 0 auto;
    padding-top: 0;
    padding-bottom: 10px;
}

.container {
    padding-left: 0;
    padding-right: 0;
}

.clearfix {
    clear: both;
}

/* ====== LINK STYLING ====== */
.logout-link,
.text-pink,
#tosLink,
.text-decoration-none,
.nav-link.pink-text,
.card-footer a {
    color: var(--vr-pink) !important;
    text-decoration: none !important;
    transition: color 0.2s !important;
}

.logout-link:hover,
.text-pink:hover,
#tosLink:hover,
.text-decoration-none:hover,
.nav-link.pink-text:hover,
.card-footer a:hover {
    color: var(--vr-pink-hover) !important;
    text-decoration: underline !important;
}

/* Link separator styling */
.link-separator {
    font-weight: normal;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0.8;
}

.dark-container {

    padding-bottom: 1rem;
    min-height: 80vh;
    display: block;
    width: 100%;
    max-width: 100%;
}

.dark-container .row {
    width: 100%;
    margin: 0 auto;
}

.dark-container.container {
    max-width: none;
    padding-left: 10px;
    padding-right: 10px;
}

/* Consistent width for authentication columns */
.col-lg-8,
.dark-container .col-lg-8 {
    margin: 0 auto;
    float: none;
    max-width: 650px;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

/* ====== CARD STYLING ====== */
.dark-card {
    background-color: rgba(22, 22, 22, 0.80);
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: 100%;
    margin: 0 auto;
}

.card-header {
    font-weight: 700;
    font-size: 1.8rem;
    color: var(--vr-white);
    padding: 1rem 1rem;
    margin-bottom: 5px;
    background-color: rgba(0, 0, 0, 0.3);
    border-bottom: none;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.card-header h2 {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem 4rem;
    color: var(--vr-white);
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.2);
    border-top: none;
    padding: 1rem;
    text-align: center;
    color: var(--vr-white);
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.card-footer p,
.card-footer p.mb-0 {
    margin-bottom: 0;
    margin-top: 0;
}

/* ====== FORM COMPONENTS ====== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #f8f9fa;
}

.form-control {
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.25rem rgba(52, 152, 219, 0.25);
}

.form-text, .optional-label {
    font-size: 0.85rem;
    color: #ddd;
}

/* Readonly inputs */
input[readonly].form-control,
.form-control[readonly] {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ddd;
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.1);
}

input[readonly].form-control:focus,
.form-control[readonly]:focus {
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: none;
}

/* Override Bootstrap's default validation colors */
.is-invalid {
    border-color: var(--vr-pink) !important;
}

.invalid-feedback {
    color: var(--vr-pink) !important;
}

/* Password requirements centering */
.password-requirements {
    text-align: center !important;
    margin: 0.5rem auto !important;
    padding: 1.25rem 1rem !important;
    font-size: 1.3rem;
    width: 100% !important;
}

.password-requirements ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: inline-block !important;
    text-align: center !important;
}

.password-requirements ul li {
    text-align: center !important;
    width: 100% !important;
}

/* License key input styling */
.license-key-input {
    font-family: 'Consolas', 'Courier New', monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Initially hide the password pane */
.password-pane {
    margin-bottom: 0;
    display: none;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.password-pane-divider {
    margin: 15px 0 0;
    border: none;
    background-color: transparent;
    border-top: 1px solid #444;
}

.update-password-toggle {
    padding-top: 15px;
    margin-top:25px;
    margin-bottom: 0;
    border-top: 1px solid #444;
}

.update-password-toggle span {
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
}

/* When open, reveal the password pane */
.password-pane.open {
    display: block;
    max-height: 1000px; /* adjust as needed */
    opacity: 1;
    margin-bottom: 0;
}

#togglePasswordPane {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    border: none;
    background: none;
}

#togglePasswordPane a {
    text-decoration: none !important;
}

#togglePasswordPane:hover {
    text-decoration: none !important;
}

#togglePasswordPane:focus {
    outline: none;
    box-shadow: none;
    border: none;
    text-decoration: none;
}

#lockIcon {
    margin-left: 5px;
    font-size: 1.25rem;
    border: none;
}

#lockIcon.unlocked {
    color: #3498db;
    border: none;
}

.form-action-container {
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* ====== BUTTON STYLING ====== */
.btn {
    font-family: 'Geogrotesque Medium', sans-serif;
    font-size: 1.6rem;
    line-height: 1;               /* lock text height */
    text-transform: uppercase;
    color: var(--vr-blue);
    background-color: rgba(var(--vr-blue-rgb,0,123,255),0.2);
    border: 1px solid var(--vr-blue);
    border-radius: 5px; 
    padding: 1rem 1.5rem;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: middle;

    /* remove default link underline and prevent outline bleed */
    text-decoration: none;
    background-clip: padding-box;

    /* only animate color & background */
    transition: background-color 0.2s ease-in-out,
                color            0.2s ease-in-out,
                border-color     0.2s ease-in-out;
    /* remove opacity changes entirely */
    opacity: 1 !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn:hover {
    background-color: var(--vr-blue);
    color: #000;
    border-color: var(--vr-blue);
    /* no opacity change here */
}

.btn:active {
    /* same visuals as hover—no opacity change */
    background-color: var(--vr-blue);
    color: #000;
    border-color: var(--vr-blue);
}

.btn:focus {
  outline: 1px solid transparent;
  outline-offset: 1px;
}

.btn:focus-visible {
    /* outline-only focus ring—does not affect layout */
    outline: 1px solid rgba(var(--vr-blue-rgb,0,123,255),0.5);
    outline-offset: 1px;
}

.btn-sm {
    font-size: 1.4rem; /* Smaller font size for small buttons */
    padding: 0.4rem 0.6rem; /* Adjust padding for small buttons */
}

/* Icon styling within buttons */
.btn i {
    display: inline-block;
    margin-right: 1rem;
}

.btn i:only-child,
.btn-sm.btn-outline-secondary i:only-child {
    margin: 0;
}

.btn-action-wide {
    width: 40%;
    margin-left: auto;
    margin-right: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* For d-grid containers */
.d-grid {
    display: flex;
    justify-content: center;
}

/* Auth form wrappers */
.registration-form-wrapper,
.login-form-wrapper {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    padding: 25px;
    margin: 40px auto;
    max-width: 600px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Section title styling with icons */
.section-title {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

/* Override the general color rule for the alert close button 'x' */
.alert .close span {
    color: #000; 
    text-shadow: none;
}

/* Ensure hover state is also visible */
.alert .close:hover span,
.alert .close:focus span {
    color: #000; 
    text-shadow: none;
}

/* Vertically center close button in .alert-dismissible across all breakpoints */
.alert-dismissible {
    position: relative;
    padding-right: 3rem;
}
.alert-dismissible .close {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
}

/* Consolidated Terms-of-Service checkbox styling */
.terms-checkbox-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
  gap: 0.5rem;
  margin-bottom: 0 !important;
}
.terms-checkbox-container .input-text-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.terms-checkbox-container label.form-check-label {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0;
  gap: 0.25rem;
}
.terms-checkbox-container .input-text-group {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.terms-checkbox-container .input-text-group > input[type="checkbox"] {
  margin: 0 !important;
  vertical-align: middle !important;
  align-self: center !important;
}
@media (max-width: 576px) {
  .terms-checkbox-container {
    flex-direction: column;
  }
  .terms-checkbox-container .input-text-group {
    margin-bottom: 0 !important;
  }
  .terms-checkbox-container #tosLink {
    display: block;
    margin: 0.5rem 0 0;
    text-align: center;
  }
}

/* ====== RESPONSIVE STYLES ====== */
/* Desktop and large screens */
@media (min-width: 992px) {
    .col-lg-8, 
    .dark-container .col-lg-8 {
        max-width: 650px;
        width: 650px;
    }
    
    .btn-action-wide {
        width: 40%;
    }
}

/* Tablets */
@media (min-width: 768px) and (max-width: 991px) {
    .btn-action-wide {
        width: 50%;
    }
    
    /* Prevent zoom on iOS inputs */
    input.form-control, 
    select.form-control, 
    textarea.form-control {
        font-size: 14px;
    }
    
    /* Larger touch targets */
    .form-control {
        min-height: 44px;
    }
}

/* Mobile devices */
@media (max-width: 767px) {
    .dark-container {
        padding-left: 1rem; /* Added for mobile margin */
        padding-right: 1rem;
    }
    
    .btn-action-wide {
        width: 70%;
    }
    
    /* Remove row margins too */
    .dark-container .row {
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Ensure card uses full width */
    .dark-card {
        margin-left: 0;
        margin-right: 0;
    }
      /* Navbar and footer media queries moved to _Layout.cshtml.css */
}

/* Small phones */
@media (max-width: 576px) {
    /* Background images */
    .bg1, .bg2 {
        background-attachment: scroll;
        background-size: cover;
    }
      /* Navbar styling moved to _Layout.cshtml.css */
    
    .dark-container {
        padding-left: 1rem; /* Added for small phones margin */
        padding-right: 1rem;
        max-width: 100%;
        width: 100%;
    }
    
    /* On small screens, force Terms of Service link onto its own line */
    .terms-checkbox-container .form-check-label a {
        flex: 0 0 100%;
        margin-top: 0.25rem;
        text-align: center;
    }

    /* Remove bottom margin from the form group itself */
    .terms-checkbox-container {
        margin-bottom: 0 !important;
    }
    /* Remove gap under the checkbox+text group */
    .terms-checkbox-container .form-check-label {
        gap: 0 !important;
    }
    /* Remove any extra bottom margin on the input-text-group */
    .terms-checkbox-container .input-text-group {
        margin-bottom: 0 !important;
    }
    /* Remove top margin from the Terms of Service link */
    .terms-checkbox-container a#tosLink {
        margin-top: 0 !important;
    }
}

/* Very small screens */
@media (max-width: 380px) {
    .card-body {
        padding: 1.5rem 2rem;
    }
}

/* Tiny screens */
@media (max-width: 360px) {    /* Navbar styling for tiny screens moved to _Layout.cshtml.css */
    .card-body {
        padding: 1.5rem 2rem;
    }

}