/*
Theme Name: AWTIM Custom Theme
Theme URI: https://awtim.org
Author: AWTIM
Description: Lightweight theme supporting the AWTIM Tailwind Header, Footer, Mobile Action Bar, and Enquiry Modal for Elementor landing pages.
Version: 1.0.5
Text Domain: awtim-theme
*/

/* Hide scrollbar for the modal if it gets too long, but keep functionality */
.modal-scroll::-webkit-scrollbar {
    width: 6px;
}
.modal-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

/* Ensure smooth bottom padding on mobile so footer isn't hidden behind sticky bar */
@media (max-width: 640px) {
    body {
        padding-bottom: 60px;
    }
}

/* Animated Gradient Course Title */
.animated-course-title,
.animated-course-title .elementor-heading-title {
    background: linear-gradient(
        to right,
        #7953cd 20%,
        #00affa 30%,
        #0190cd 70%,
        #764ada 80%
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-fill-color: transparent;
    background-size: 500% auto;
    animation: textShine 5s ease-in-out infinite alternate;
    display: inline-block;
}

@keyframes textShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Ensure Elementor buttons with .enquire-btn have pointer cursor */
.enquire-btn {
    cursor: pointer;
}

/* =========================================
   Primary Menu Styling (Desktop)
   ========================================= */
.awtim-primary-menu li {
    position: relative;
    padding: 1.5rem 0; /* Creates a larger hover area to prevent dropdowns from closing */
}

.awtim-primary-menu > li > a {
    color: #374151; /* text-gray-700 */
    transition: color 0.2s ease-in-out;
    text-decoration: none;
    font-weight: 500;
}

.awtim-primary-menu li a:hover,
.awtim-primary-menu li.current-menu-item > a {
    color: #1e3a8a; /* text-primary */
}

/* Desktop Sub-Menu (Dropdown) */
.awtim-primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    display: none; /* Hidden by default */
    min-width: 220px;
    background-color: #ffffff;
    border: 1px solid #f3f4f6; /* border-gray-100 */
    border-radius: 0.375rem; /* rounded-md */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); /* shadow-lg */
    padding: 0.5rem 0;
    margin: 0;
    list-style: none;
}

/* Show Sub-Menu on Hover (Desktop only) */
@media (min-width: 1024px) {
    .awtim-primary-menu li:hover > .sub-menu {
        display: block;
    }
}

.awtim-primary-menu .sub-menu li {
    padding: 0; /* Remove the generous padding used for top-level */
}

.awtim-primary-menu .sub-menu li a {
    display: block;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem; /* text-sm */
    color: #4b5563; /* text-gray-600 */
}

.awtim-primary-menu .sub-menu li a:hover {
    background-color: #f9fafb; /* bg-gray-50 */
    color: #1e3a8a; /* text-primary */
}

/* =========================================
   Mobile/Tablet Dropdown Menu Styling 
   ========================================= */
.awtim-mobile-menu li {
    position: relative;
    list-style: none;
}

.awtim-mobile-menu li a {
    display: block;
    padding: 0.875rem 0;
    color: #374151; /* text-gray-700 */
    border-bottom: 1px solid #f3f4f6; /* border-gray-100 */
    transition: color 0.2s ease-in-out;
    text-decoration: none;
    font-weight: 500;
}

.awtim-mobile-menu > li:last-child > a {
    border-bottom: none;
}

.awtim-mobile-menu li a:hover,
.awtim-mobile-menu li.current-menu-item > a {
    color: #1e3a8a; /* text-primary */
}

/* Mobile Sub-Menu (Always visible inline) */
.awtim-mobile-menu .sub-menu {
    padding-left: 1.25rem; /* Indent sub-menus */
    margin: 0;
    background-color: #f9fafb; /* Slight background to distinguish */
    border-bottom: 1px solid #f3f4f6;
}

.awtim-mobile-menu .sub-menu li a {
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.875rem; /* text-sm */
    color: #6b7280; /* text-gray-500 */
    padding: 0.75rem 0;
}

.awtim-mobile-menu .sub-menu li:last-child a {
    border-bottom: none;
}

/* =========================================
   Contact Form 7 Styling
   ========================================= */
.wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.awtim-cf7-input {
    display: block;
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem; /* pl-10 pr-3 py-3 */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    border-radius: 0.5rem; /* rounded-lg */
    line-height: 1.25rem; /* leading-5 */
    background-color: #f9fafb; /* bg-gray-50 */
    color: #111827; /* text-gray-900 */
    transition: all 0.2s ease-in-out;
}

.awtim-cf7-input::placeholder {
    color: #9ca3af; /* placeholder-gray-400 */
}

.awtim-cf7-select {
    display: block;
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem; /* pl-3 pr-10 py-3 */
    font-size: 1rem; /* text-base */
    border: 1px solid #e5e7eb; /* border-gray-200 */
    border-radius: 0.5rem; /* rounded-lg */
    background-color: #f9fafb; /* bg-gray-50 */
    color: #374151; /* text-gray-700 */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease-in-out;
}

.awtim-cf7-input:focus,
.awtim-cf7-select:focus {
    outline: none;
    background-color: #ffffff; /* focus:bg-white */
    border-color: #1e3a8a; /* focus:border-primary */
    box-shadow: 0 0 0 2px #1e3a8a; /* focus:ring-2 focus:ring-primary */
}

/* Modal CF7 Input & Select Styles */
.awtim-cf7-modal-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem; /* pl-9 pr-3 py-2 */
    border: 1px solid #d1d5db; /* border-gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    font-size: 0.875rem; /* sm:text-sm */
    background-color: #ffffff;
    color: #111827;
    transition: all 0.2s ease-in-out;
}

.awtim-cf7-modal-select {
    display: block;
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #374151;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s ease-in-out;
}

.awtim-cf7-modal-input:focus,
.awtim-cf7-modal-select:focus {
    outline: none;
    border-color: #1e3a8a; /* focus:border-primary */
    box-shadow: 0 0 0 2px #1e3a8a; /* focus:ring-2 */
}

/* Tidy up CF7 Validation & Spinner */
.wpcf7-not-valid-tip {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

.wpcf7 form .wpcf7-response-output {
    margin: 0.75rem 0 0 0;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    text-align: center;
}

.awtim-submit-btn .wpcf7-spinner,
.awtim-modal-submit-btn .wpcf7-spinner {
    display: none;
}