/* Additional styles for Stadio website */

/* Base transitions and box-sizing */
*, *::before, *::after {
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
    box-sizing: border-box;
}

/* Base styles from index.php */
body {
    font-family: 'Inter', 'Arial', sans-serif;
    background: url('blue-bg.jpg') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    padding: 1rem;
    opacity: 0;
    animation: fadeIn 0.3s ease-in forwards;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Logo container styles */
.logo-container {
    height: 80px;
    width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Prevent content shift */
.container {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
    max-width: 28rem;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
}

/* RTL support */
html[dir="rtl"] .space-x-4 > * + * {
    margin-right: 1rem;
    margin-left: 0;
}

/* Icon container styles */
.icon-container {
    width: 96px;
    height: 96px;
    margin: 0 auto;
}

.icon-container > div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-container svg {
    width: 48px;
    height: 48px;
}

/* Critical form styles */
#phoneInputContainer {
    display: flex;
    align-items: center;
    border: 2px solid;
    border-radius: 9999px;
    overflow: hidden;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.phone-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    outline: none;
    color: #374151;
}

/* Loading spinner */
.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid white;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Font loading optimization with proper fallbacks */
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: local('Tajawal Regular'), local('Tajawal-Regular'),
         url('https://fonts.gstatic.com/s/tajawal/v9/Iura6YBj_oCad4k1l_6gLuvPDQ.woff2') format('woff2'),
         url('https://fonts.gstatic.com/s/tajawal/v9/Iura6YBj_oCad4k1l_6gLuvPDQ.woff') format('woff');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: local('Tajawal Medium'), local('Tajawal-Medium'),
         url('https://fonts.gstatic.com/s/tajawal/v9/Iurf6YBj_oCad4k1l8KiHrfvPoCp.woff2') format('woff2'),
         url('https://fonts.gstatic.com/s/tajawal/v9/Iurf6YBj_oCad4k1l8KiHrfvPoCp.woff') format('woff');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: local('Tajawal Bold'), local('Tajawal-Bold'),
         url('https://fonts.gstatic.com/s/tajawal/v9/Iurf6YBj_oCad4k1l8KCGLfvPoCp.woff2') format('woff2'),
         url('https://fonts.gstatic.com/s/tajawal/v9/Iurf6YBj_oCad4k1l8KCGLfvPoCp.woff') format('woff');
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE80-FEFC;
}

/* Fallback for Latin characters */
@font-face {
    font-family: 'Tajawal';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local('Tajawal Regular'), local('Tajawal-Regular'),
         url('https://fonts.gstatic.com/s/tajawal/v9/Iura6YBj_oCad4k1l_6gLuvPDQ.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Additional critical styles with improved responsiveness */
.w-full { width: 100%; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-x-reverse { flex-direction: row-reverse; }
.rounded-full { border-radius: 9999px; }
.bg-white { background-color: white; }
.text-white { color: black; }
.font-bold { font-weight: 400; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.p-4 { padding: 1rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.text-xs { font-size: 1rem; color: black; font-weight: 400; }
.text-gray-700 { color: #374151; }
.bg-gray-100 { background-color: #F3F4F6; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.transform { transform: translateZ(0); }
.rotate-12 { transform: rotate(12deg); }
.-rotate-12 { transform: rotate(-12deg); }
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.bg-gold { background-color: #D4A017; }
.bg-gold-hover { background-color: #B8860B; }
.hover\:bg-gold-hover:hover { background-color: #B8860B; }
.text-gold { color: #D4A017; }
.border-gold { border-color: #D4A017; }

/* Make device icons visible on blue background */
.device-icon svg {
    color: #f44545 !important; 
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Ensure buttons are visible */
.bg-gray-300 { background-color: #D1D5DB !important; }
.text-gray-600 { color: #4B5563 !important; }
.min-h-screen { min-height: 100vh; }
.relative { position: relative; }
.hidden { display: none; }
.max-w-md { max-width: 28rem; }

/* Enhanced text visibility with responsive fonts */
.text-lg {
    color: black;
    font-weight: 400;
    font-size: 1rem; /* Base desktop size */
}
.cptpl_price {
    color: black !important;
    font-weight: 400;
    line-height: 1.6;
    font-size: 0.8rem; /* Reduced for desktop */
}
.cptpl_service {
    color: black !important;
    font-weight: 500;
    font-size: 0.85rem;
    margin-bottom: 30px;
}
.footer-link {
    color: white !important; /* Changed to white for visibility on blue background */
    font-weight: 400;
    font-size: 0.7rem; /* Reduced for desktop */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); /* Added shadow for better contrast */
}
#formTitle {
    color: black;
    font-weight: 400;
    font-size: 1.15rem; /* Reduced for desktop */
}

/* Language switcher base styles - simple and clean */
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.language-switcher a {
    display: inline-block;
    padding: 5px 12px;
    margin: 0 2px;
    background: #fff;
    color: black;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.language-switcher a:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.language-switcher a.active {
    background: rgba(0, 0, 0, 0.8);
    color: white;
}

/* Keep phone input fields consistent - always LTR for numbers */
.phone-input, .pin-input {
    direction: ltr !important;
    text-align: left !important;
}

/* Keep form layout consistent - always show prefix on left, input on right */
#phoneInputContainer, #pinInputContainer {
    flex-direction: row !important;
    direction: ltr !important;
}

/* Ensure prefix stays on the left */
#phoneInputContainer .px-4.py-3.bg-gray-100,
#pinInputContainer .px-4.py-3.bg-gray-100 {
    order: 1;
    border-right: 1px solid #d1d5db;
    border-left: none;
}

/* Ensure input field stays on the right */
#phoneInputContainer .phone-input,
#pinInputContainer .pin-input {
    order: 2;
}

/* RTL/LTR adjustments for other elements */
html[dir="ltr"] .space-x-4 > * + * {
    margin-left: 1rem;
    margin-right: 0;
}

/* Animations */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.cloud-animation {
    animation: float 3s ease-in-out infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* OTP Autofill Animation */
@keyframes otpPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* Autofilled OTP input styling */
.pin-input.autofilled {
    background-color: #f8f4e5;
    border: 2px solid #4caf50 !important;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.5);
    animation: otpPulse 1.5s infinite;
}

/* Device icons hover effects */
.device-icon {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.device-icon:hover {
    transform: translateY(-5px) !important;
    filter: brightness(1.2);
}

/* Background patterns */
.dots-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: radial-gradient(#40E0D0 1px, transparent 1px),
                      radial-gradient(#FF69B4 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.1;
    pointer-events: none;
    z-index: -1;
}

/* Form focus effects */
#phoneInputContainer:focus-within,
#pinInputContainer:focus-within {
    border-color: #40E0D0;
    box-shadow: 0 0 0 3px rgba(64, 224, 208, 0.1);
}

/* Button hover effects */
button[type="submit"] {
    transition: all 0.3s ease;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(64, 224, 208, 0.3);
}

button[type="submit"]:active {
    transform: translateY(0);
}

/* Disclaimer text styling - removed duplicate .cptpl_price definition */

/* Footer links styling */
.footer-links {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.footer-link {
    /* display: inline-block; */
    /* margin: 0.25rem 0; */
    padding: 0.25rem 0.5rem;
    background: none;
    color: #000 !important;
    /* text-decoration: none; */
    font-weight: 400;
    font-size: 0.75rem;
    /* transition: all 0.3s ease; */
    /* text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); */
}



.footer-link:hover {
    color: #2d54c1 !important; /* Gold on hover */
    text-decoration: underline;
}

/* Tablet and larger mobile devices (415px - 640px) */
@media (min-width: 415px) and (max-width: 640px) {
    /* Reduce overall spacing */
    body {
        padding: 0.5rem;
    }
    
    /* Make container take less vertical space */
       .container {
        padding-top: 2.5rem;
        padding-bottom: 0.5rem;
    }
    
    /* Reduce logo size */
    .logo-container {
        height: 60px;
        margin-bottom: 1rem;
    }
    
    /* Reduce promotional text spacing */
    .text-lg.mb-8 {
        margin-bottom: 0.75rem !important;
        font-size: 0.95rem !important;
    }
    
    /* Make cloud icon smaller */
    .icon-container {
        width: 70px !important;
        height: 70px !important;
        margin-bottom: 0.75rem !important;
    }
    
    .icon-container .bg-white {
        padding: 0.75rem !important;
    }
    
    .icon-container svg {
        width: 36px !important;
        height: 36px !important;
    }
    
    /* Reduce form spacing */
    #formTitle {
        margin-bottom: 0.5rem !important;
        font-size: 0.8rem !important;
    }
    
    .mb-6 {
        margin-bottom: 0.75rem !important;
    }
    
    /* Make device icons smaller and with less spacing */
    .device-icons-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
        margin-bottom: 0.5rem !important;
    }
    
    .device-icon svg {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .dots-pattern {
        background-size: 15px 15px;
    }
    
    /* Disclaimer text */
    .cptpl_price {
        font-size: 0.85rem;
        padding: 0 0rem;
        margin: 0.5rem 0 0.25rem 0;
    }
    
    .cptpl_price p {
        margin: 0.15rem 0;
    }
    
    /* Footer links */
    .cptpl_terms {
        margin-top: 0.25rem;
    }
    
    /* Mobile footer links adjustments */
    .footer-link {
        font-size: 0.75rem !important;
        padding: 0.25rem 0.5rem !important;
    }
}

/* iPhone 6/7/8 */
@media (min-width: 360px) and (max-width: 414px) {
    body {
        padding: 0.75rem;
    }
    
    .container {
        max-width: 100%;
        padding: 0 0.75rem;
    }
    
    .logo-container {
        height: 55px;
        margin-bottom: 0.75rem;
    }
    
    .text-lg {
        font-size: 1.1rem !important;
    }
    
    .cptpl_service {
        font-size: 0.75rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    .icon-container {
        width: 65px !important;
        height: 65px !important;
        margin-bottom: 0.5rem !important;
    }
    
    .icon-container svg {
        width: 32px !important;
        height: 32px !important;
    }
    
    #formTitle {
        font-size: 0.85rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    #phoneInputContainer, #pinInputContainer {
        height: 2.75rem;
    }
    
    .phone-input, .pin-input {
        font-size: 0.95rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    
    button[type="submit"] {
        padding: 0.6rem 1rem !important;
        font-size: 0.95rem !important;
    }
    
    .cptpl_price {
        font-size: 0.65rem !important;
        margin: 0.5rem 0 0.5rem 0 !important;
    }
    
    .device-icons-container {
        margin-bottom: 0.5rem !important;
        margin-top: 0.5rem !important;
        gap: 0.5rem !important;
    }
    
    .device-icon svg {
        width: 1.75rem !important;
        height: 1.75rem !important;
    }
    
    .footer-link {
        font-size: 0.65rem !important;
        padding: 0.2rem 0.4rem !important;
    }
    
    .language-switcher {
        top: 15px;
        right: 15px;
    }
    
    .language-switcher a {
        font-size: 12px;
        padding: 4px 10px;
    }
}

/* Small mobile screens */
@media (max-width: 359px) {
    /* Further reduce sizes for very small screens */
    .text-lg {
        font-size: 0.95rem !important;
    }
    
    .logo-container {
        height: 50px;
    }
    
    .icon-container {
        width: 60px !important;
        height: 60px !important;
    }
    
    .cptpl_price {
        font-size: 0.85rem;
        padding: 0 0rem;
    }
    
    .device-icon svg {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    #phoneInputContainer, #pinInputContainer {
        height: 2.5rem;
    }
    
    button[type="submit"] {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
}

/* Print styles */
@media print {
    .cloud-animation,
    .device-icons-container,
    .dots-pattern {
        display: none;
    }
}


.servicedesc {
    opacity: 0.001;
    pointer-events: none; 
    user-select: none;
}

/* Disabled button styles */
button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Countdown timer styles */
#resendCountdown {
    font-size: 0.9rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background-color: #f3f4f6;
}

#countdownTimer {
    font-weight: bold;
    color: #40E0D0;
}

/* Adjust countdown timer for mobile */
@media (max-width: 640px) {
    #resendCountdown {
        font-size: 0.8rem;
        padding: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    /* Adjust input padding for mobile */
    .phone-input, .pin-input {
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Adjust PIN form buttons */
    #pinForm button {
        padding-top: 0.5rem !important;
        padding-bottom: 0.5rem !important;
    }
}

/* Modal styles */
#almadarModal, #libyaShortcodeModal {
    animation: fadeIn 0.3s ease-in-out;
}

#almadarModal .bg-white, #libyaShortcodeModal .bg-white {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

/* Error message styling */
.pin-error-message {
    background-color: #ffebee;
    color: #c62828;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid #c62828;
}