/**
 * Marine World Login - Flowdash Style
 * Modern login interface using Flowdash design system
 */

/* Import Flowdash Core Styles */
@import url('../flowdash/css/flowdash-core.css');

/* Import Roboto font from Google Fonts */
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500,700');

/* Marine World Blue Theme CSS Variables for Login */
:root {
    /* Primary Colors - Marine World Blue */
    --primary: #0084ff;
    --primary-hover: #0070dd;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #00bfff;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8fafc;
    --dark: #1a1d2b;
    --blue: #0084ff;
    --teal: #16BA71;
    --purple: #5163C5;
    --dark-gray: #64748b;
    --light-gray: #e8f4ff;
    --muted-light: #f0f9ff;

    /* Text colors */
    --text-primary: #1a1d2b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    /* Background colors */
    --bg-primary: #f8fafc;
    --bg-white: #ffffff;
    --bg-dark: #1a1d2b;
    --bg-overlay: rgba(0, 61, 122, 0.8);

    /* Border colors - Marine World Blue Tinted */
    --border-color: #e8f4ff;
    --border-light: #f0f9ff;

    /* Shadows - Blue Tinted */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 132, 255, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 132, 255, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 132, 255, 0.175);

    /* Border radius - Modern Rounded */
    --radius: 8px;
    --radius-lg: 12px;
    --radius-sm: 6px;
}

/* Loading Screen Styles */
.mwb-login-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    z-index: 99999;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mwb-loading-overlay {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 132, 255, 0.15);
    border: 1px solid rgba(0, 132, 255, 0.1);
    text-align: center;
    min-width: 320px;
    max-width: 400px;
    width: 90%;
    animation: loadingSlideUp 0.8s ease-out;
}

@keyframes loadingSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mwb-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.mwb-loading-logo img {
    max-height: 60px;
    width: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: logoFloat 3s ease-in-out infinite;
}

.mwb-loading-logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #0084ff;
    text-shadow: 0 2px 4px rgba(0, 132, 255, 0.1);
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Modern Spinner Ring */
.mwb-spinner-ring {
    position: relative;
    width: 60px;
    height: 60px;
}

.mwb-spinner-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 48px;
    height: 48px;
    margin: 6px;
    border: 4px solid #0084ff;
    border-radius: 50%;
    animation: spinnerRing 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #0084ff transparent transparent transparent;
}

.mwb-spinner-ring div:nth-child(1) { animation-delay: -0.45s; }
.mwb-spinner-ring div:nth-child(2) { animation-delay: -0.3s; }
.mwb-spinner-ring div:nth-child(3) { animation-delay: -0.15s; }

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

.mwb-loading-text {
    width: 100%;
}

.mwb-loading-text p {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* Progress Bar */
.mwb-loading-progress {
    width: 100%;
    height: 4px;
    background: rgba(0, 132, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.mwb-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0084ff, #00bfff);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.mwb-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: progressShimmer 2s infinite;
}

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

/* Success Animation */
@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Login Interface Transition */
#mwb-login-interface {
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Button States */
.btn-success {
    background-color: var(--success) !important;
    border-color: var(--success) !important;
    animation: buttonSuccess 0.6s ease;
}

@keyframes buttonSuccess {
    0% {
        background-color: var(--primary);
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        background-color: var(--success);
        transform: scale(1);
    }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .mwb-loading-overlay {
        padding: 40px 30px;
        border-radius: 15px;
        margin: 20px;
    }
    
    .mwb-loading-content {
        gap: 25px;
    }
    
    .mwb-loading-logo-text {
        font-size: 24px;
    }
    
    .mwb-spinner-ring {
        width: 50px;
        height: 50px;
    }
    
    .mwb-spinner-ring div {
        width: 40px;
        height: 40px;
        margin: 5px;
    }
}

/* Critical: Reset all spacing for login pages */
.mwb-frontend-admin-panel,
.mwb-frontend-admin-panel * {
    box-sizing: border-box;
}

/* Complete reset for login screens */
body:has(.mwb-login-loading-screen),
html:has(.mwb-login-loading-screen),
body.layout-login,
html.layout-login {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    height: 100% !important;
    min-height: 100vh !important;
}

/* Override any WordPress or theme container styles */
.mwb-frontend-admin-panel .layout-login,
.mwb-frontend-admin-panel #mwb-login-interface {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure no spacing from WordPress admin bar or themes */
body:has(.mwb-login-loading-screen) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.admin-bar:has(.mwb-login-loading-screen) {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Override common WordPress/theme containers that might add spacing */
.site-content,
.content-area,
.main-content,
.entry-content,
.elementor-section,
.elementor-container,
.elementor-row,
.elementor-column {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure Elementor widgets don't add spacing */
.elementor-widget:has(.mwb-login-loading-screen),
.elementor-widget:has(#mwb-login-interface) {
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

/* Initially hide login interface until loading completes */
#mwb-login-interface {
    visibility: hidden;
    opacity: 0;
    display: none;
}

/* Allow JavaScript to override the hidden state - make it work exactly like loading screen */
#mwb-login-interface.mwb-show {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 99999 !important;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%) !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    transform: none !important;
}

/* The .layout-login inside should just be the container */
#mwb-login-interface.mwb-show .layout-login {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 1rem !important;
    background: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

/* Ensure loading screen covers everything */
.mwb-login-loading-screen {
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
}

/* Additional resets for layout consistency */
.layout-login * {
    margin: 0;
    padding: 0;
}

/* Prevent any scrollbars during loading and login */
body:has(.mwb-login-loading-screen),
body:has(#mwb-login-interface.mwb-show) {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
}

/* Force full viewport coverage */
.mwb-frontend-admin-panel {
    position: relative;
    width: 100%;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
}

/* Restore necessary padding only to form elements */
.layout-login__form,
.layout-login__form .form-group,
.layout-login__form .form-control,
.layout-login__form .btn,
.layout-login__form .input-group-text,
.layout-login__form .custom-control-label,
.layout-login__form .custom-control,
.layout-login__form .custom-control-label::before,
.layout-login__form .custom-control-label::after {
    margin: initial;
    padding: initial;
}

/* Ensure form elements are visible */
.layout-login__form * {
    opacity: 1;
    visibility: visible;
}

/* Ensure the login container has no inherited padding/margins */
.layout-login,
.layout-login .container,
.layout-login .container-fluid,
.layout-login .elementor-container,
.layout-login .elementor-section,
.layout-login .elementor-widget-wrap {
    margin: 0 !important;
    padding: 0 !important;
}

/* Login layout container */
.layout-login {
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    margin: 0;
    box-sizing: border-box;
}

/* Background overlay - Hidden for clean gradient background */
.layout-login__overlay {
    display: none;
}

/* Login form container - White Card with Blue Shadow (matching About page .glass-card) */
.layout-login__form {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 132, 255, 0.15);
    border: 1px solid rgba(0, 132, 255, 0.1);
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Brand/Logo section */
.navbar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.navbar-brand-icon {
    margin-right: 0.75rem;
    filter: hue-rotate(200deg);
}

/* Welcome section */
.layout-login__form h4 {
    font-size: 1.75rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    text-align: center;
}

.layout-login__form p {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9375rem;
}

/* Form styling */
.form-group {
    margin-bottom: 1.5rem;
}

.text-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Input group with prepended icons */
/* Form group spacing */
.layout-login__form .form-group {
    margin-bottom: 20px !important;
}

.layout-login__form .form-group.mb-5 {
    margin-bottom: 25px !important;
    margin-top: 10px !important;
}

.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.input-group-merge .form-control-prepended {
    padding-left: 50px !important;
}

/* Input field styling - with !important to override flowdash */
.layout-login__form .form-control,
.layout-login__form .form-control-prepended,
.layout-login__form input[type="text"],
.layout-login__form input[type="password"],
.layout-login__form input[type="email"] {
    display: block !important;
    width: 100% !important;
    padding: 15px 20px !important;
    padding-left: 50px !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.5 !important;
    color: #1a1d2b !important;
    background-color: #f8fafc !important;
    background-clip: padding-box !important;
    border: 2px solid #e8f4ff !important;
    border-radius: 12px !important;
    transition: all 0.3s ease !important;
    box-sizing: border-box !important;
    height: auto !important;
}

.layout-login__form .form-control:focus,
.layout-login__form .form-control-prepended:focus,
.layout-login__form input[type="text"]:focus,
.layout-login__form input[type="password"]:focus,
.layout-login__form input[type="email"]:focus {
    color: #1a1d2b !important;
    background-color: #ffffff !important;
    border-color: #0084ff !important;
    outline: 0 !important;
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1) !important;
}

.layout-login__form .form-control::placeholder,
.layout-login__form .form-control-prepended::placeholder,
.layout-login__form input::placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
}

/* Input group prepend - Icon container */
.input-group-prepend {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    padding: 0;
}

/* Dashicons Styling Fix */
.input-group-text .dashicons {
    font-family: dashicons;
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 1;
    display: inline-block;
    color: #0084ff;
    speak: never;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.input-group-text .dashicons-admin-users:before {
    content: "\f110";
}

.input-group-text .dashicons-lock:before {
    content: "\f160";
}

/* Custom checkbox - Simple inline styling */
.custom-control {
    position: relative;
    display: block;
    min-height: 1.5rem;
    margin: 1rem 0;
    padding-left: 0;
}

.custom-control.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-control-input {
    position: relative;
    width: 20px;
    height: 20px;
    margin: 0;
    opacity: 1;
    cursor: pointer;
    accent-color: #0084ff;
    flex-shrink: 0;
}

.custom-control-label {
    position: relative;
    margin: 0;
    color: #666;
    font-size: 14px;
    font-weight: 400;
    cursor: pointer;
    line-height: 1.5;
    user-select: none;
}

/* Hide the default ::before and ::after pseudo-elements */
.custom-control-label::before,
.custom-control-label::after {
    display: none;
}

/* Style the native checkbox */
.custom-control-input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e8f4ff;
    border-radius: 4px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-control-input[type="checkbox"]:checked {
    background: #0084ff;
    border-color: #0084ff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3e%3cpath fill='%23fff' stroke='%23fff' stroke-width='1' d='m2 6 2.5 2.5L9.5 3.5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

.custom-control-input[type="checkbox"]:hover {
    border-color: #0084ff;
}

.custom-control-input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

/* Submit button */
.btn {
    display: inline-block;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    vertical-align: middle;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    border-radius: var(--radius);
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    color: var(--bg-white);
    background: linear-gradient(135deg, #0084ff, #00bfff);
    border: none;
    font-weight: 600;
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    min-height: 48px;
    height: 48px;
    border-radius: 50px;
}

.btn-primary:hover {
    color: var(--bg-white);
    background: linear-gradient(135deg, #0070dd, #00a5e0);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 132, 255, 0.35);
}

.btn-primary:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 132, 255, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}

/* Links */
.layout-login__form a {
    color: #0084ff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease-in-out;
}

.layout-login__form a:hover {
    color: #003d7a;
    text-decoration: underline;
}

.text-body {
    color: var(--text-primary) !important;
}

.text-underline {
    text-decoration: underline;
}

/* Footer links */
.layout-login__form .form-group:last-child {
    text-align: center;
    margin-bottom: 0;
}

.layout-login__form .form-group:last-child a {
    display: inline-block;
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* Utility classes */
.d-flex {
    display: flex !important;
}

.justify-content-center {
    justify-content: center !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mb-5 {
    margin-bottom: 1rem !important;
}

.m-0 {
    margin: 0 !important;
}

.text-center {
    text-align: center !important;
}

/* Responsive design */
@media (max-width: 576px) {
    .layout-login {
        padding: 1rem;
    }
    
    .layout-login__form {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }
    
    .layout-login__form h4 {
        font-size: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}