/**
 * Unlockroads Global UI Enhancements
 * Improves spacing, typography, hover states, transitions, and accessibility
 * Loaded after bootstrap-custom.css to override theme defaults
 */

/* ============================================
   Global Spacing Normalization
   ============================================ */

/* Consistent section padding */
section.spad {
    padding: 80px 0;
}

@media (max-width: 767px) {
    section.spad {
        padding: 60px 0;
    }
}

@media (max-width: 575px) {
    section.spad {
        padding: 40px 0;
    }
}

/* Consistent container padding */
.container {
    padding-left: 15px;
    padding-right: 15px;
}

/* Consistent row spacing */
.row {
    margin-left: -15px;
    margin-right: -15px;
}

.row > [class*="col-"] {
    padding-left: 15px;
    padding-right: 15px;
}

/* Consistent margin bottom for sections */
.section-title {
    margin-bottom: 50px;
}

@media (max-width: 767px) {
    .section-title {
        margin-bottom: 40px;
    }
}

/* ============================================
   Typography Hierarchy Improvements
   ============================================ */

/* Heading hierarchy */
h1, .h1 {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.2;
    color: #0F172A;
    margin-bottom: 20px;
}

h2, .h2 {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    color: #0F172A;
    margin-bottom: 18px;
}

h3, .h3 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.4;
    color: #0F172A;
    margin-bottom: 16px;
}

h4, .h4 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.4;
    color: #0F172A;
    margin-bottom: 14px;
}

h5, .h5 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.5;
    color: #0F172A;
    margin-bottom: 12px;
}

h6, .h6 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    color: #0F172A;
    margin-bottom: 10px;
}

/* Body text */
body, p {
    font-size: 16px;
    line-height: 1.7;
    color: #64748B;
}

/* Responsive typography */
@media (max-width: 991px) {
    h1, .h1 { font-size: 36px; }
    h2, .h2 { font-size: 32px; }
    h3, .h3 { font-size: 24px; }
    h4, .h4 { font-size: 20px; }
}

@media (max-width: 767px) {
    h1, .h1 { font-size: 32px; }
    h2, .h2 { font-size: 28px; }
    h3, .h3 { font-size: 22px; }
    h4, .h4 { font-size: 18px; }
    body, p { font-size: 15px; }
}

@media (max-width: 575px) {
    h1, .h1 { font-size: 28px; }
    h2, .h2 { font-size: 24px; }
    h3, .h3 { font-size: 20px; }
    body, p { font-size: 14px; }
}

/* ============================================
   Enhanced Hover and Focus States
   ============================================ */

/* Links */
a {
    transition: color 0.3s ease, opacity 0.3s ease;
    text-decoration: none;
}

a:hover {
    opacity: 0.85;
}

a:focus {
    outline: 2px solid #0B1F3B;
    outline-offset: 2px;
}

/* Buttons */
.btn, .primary-btn, .site-btn {
    transition: all 0.3s ease;
    cursor: pointer;
    font-weight: 600;
    border-radius: 4px;
}

.btn:hover, .primary-btn:hover, .site-btn:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(11, 31, 59, 0.15);
}

.btn:focus, .primary-btn:focus, .site-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(11, 31, 59, 0.2);
}

.btn:active, .primary-btn:active, .site-btn:active {
    transform: translateY(0);
}

/* Form inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
textarea,
select {
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #0B1F3B;
    box-shadow: 0 0 0 3px rgba(11, 31, 59, 0.1);
}

/* Cards */
.card, .listing__item, .why-choose__card, .learning-style__card {
    transition: all 0.3s ease;
}

.card:hover, .listing__item:hover, .why-choose__card:hover, .learning-style__card:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ============================================
   Subtle Transitions (No Extra Libraries)
   ============================================ */

/* Smooth transitions for common elements */
* {
    transition-property: color, background-color, border-color, transform, box-shadow, opacity;
    transition-duration: 0.3s;
    transition-timing-function: ease;
}

/* Disable transitions for performance-critical elements */
img, svg, video, canvas {
    transition: none;
}

/* ============================================
   WCAG Contrast Compliance
   ============================================ */

/* Ensure sufficient contrast for all text */
.text-primary {
    color: #0F172A !important; /* 15.8:1 contrast on white */
}

.text-secondary {
    color: #64748B !important; /* 4.5:1 contrast on white */
}

/* Links must have sufficient contrast */
a {
    color: #0B1F3B; /* Deep Navy Blue - high contrast on white */
}

a:hover {
    color: #08172C; /* Darker navy on hover */
}

/* Buttons */
.btn-primary, .primary-btn, .site-btn {
    background-color: #0B1F3B;
    color: #FFFFFF; /* High contrast */
}

.btn-primary:hover, .primary-btn:hover, .site-btn:hover {
    background-color: #08172C;
    color: #FFFFFF; /* High contrast */
}

/* Success/Warning/Danger with proper contrast */
.text-success {
    color: #15803D !important;
}

.text-warning {
    color: #B45309 !important;
}

.text-danger {
    color: #B91C1C !important;
}

/* ============================================
   Mobile Stacking and Tap Targets
   ============================================ */

/* Ensure tap targets are at least 44x44px */
.btn, .primary-btn, .site-btn,
a.btn, a.primary-btn, a.site-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Mobile-friendly spacing */
@media (max-width: 767px) {
    /* Increase spacing between stacked elements */
    .row > [class*="col-"] {
        margin-bottom: 30px;
    }
    
    /* Larger tap targets on mobile */
    .btn, .primary-btn, .site-btn {
        min-height: 48px;
        padding: 14px 28px;
        font-size: 16px;
    }
    
    /* Better spacing for mobile forms */
    .form-group, .login-form-group {
        margin-bottom: 20px;
    }
}

/* ============================================
   Accessibility Improvements
   ============================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #0B1F3B;
    outline-offset: 2px;
}

/* Skip to main content link */
.skip-to-main {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0B1F3B;
    color: #FFFFFF;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-main:focus {
    top: 0;
}

/* ARIA labels support */
[aria-label] {
    cursor: help;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ============================================
   Improved Mobile Experience
   ============================================ */

@media (max-width: 575px) {
    /* Better text readability on small screens */
    body {
        font-size: 15px;
        line-height: 1.6;
    }
    
    /* Prevent horizontal scroll */
    body, html {
        overflow-x: hidden;
        max-width: 100%;
    }
    
    /* Better spacing for mobile */
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    /* Stack elements vertically on very small screens */
    .row {
        flex-direction: column;
    }
}

/* ============================================
   Loading States and Skeleton Loaders
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #F8FAFC 25%, #E5E7EB 50%, #F8FAFC 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
}

/* ============================================
   Empty States
   ============================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state__icon {
    font-size: 64px;
    color: #E5E7EB;
    margin-bottom: 20px;
}

.empty-state__title {
    font-size: 24px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 12px;
}

.empty-state__message {
    font-size: 16px;
    color: #64748B;
    margin-bottom: 24px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================
   Trust Indicators
   ============================================ */

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    color: #0B1F3B;
    font-size: 14px;
    font-weight: 600;
}

.trust-badge i {
    color: #15803D;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: #D1FAE5;
    border: 1px solid #86EFAC;
    border-radius: 20px;
    color: #14532D;
    font-size: 12px;
    font-weight: 600;
}

.verified-badge i {
    color: #15803D;
    font-size: 14px;
}

/* ============================================
   Improved Form Validation Feedback
   ============================================ */

.form-control.is-invalid,
input.is-invalid,
textarea.is-invalid,
select.is-invalid {
    border-color: #B91C1C;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3e%3cpath stroke='%23EF4444' d='M6 6L1 1m5 5l5-5M6 6l-5 5m5-5l5 5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

.form-control.is-valid,
input.is-valid,
textarea.is-valid,
select.is-valid {
    border-color: #15803D;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' viewBox='0 0 12 12'%3e%3cpath stroke='%2322C55E' d='M10 3L4.5 8.5L2 6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 8px;
    font-size: 14px;
    color: #B91C1C;
}

.valid-feedback {
    display: block;
    width: 100%;
    margin-top: 8px;
    font-size: 14px;
    color: #15803D;
}

/* ============================================
   Footer Hover Enhancements
   ============================================ */

/* Footer widget links - No Hover Effect */
.footer__widget ul li a {
    color: #64748B;
    text-decoration: none;
    display: inline-block;
}

.footer__widget ul li a:hover {
    color: #64748B !important;
    text-decoration: none;
    transform: none;
}

.footer__widget ul li a:focus {
    color: #64748B !important;
    outline: none;
}

/* Footer social links */
.footer__social a {
    color: #64748B;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-decoration: none;
}

.footer__social a:hover {
    color: #0B1F3B !important;
    background-color: #F1F5F9;
    transform: none;
}

.footer__social a:focus {
    color: #0B1F3B !important;
    background-color: #F1F5F9;
    outline: 2px solid #0B1F3B;
    outline-offset: 2px;
}

/* Footer copyright links */
.footer__copyright__links a {
    color: #64748B;
    transition: color 0.3s ease, background-color 0.3s ease;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
}

.footer__copyright__links a:hover {
    color: #0B1F3B !important;
    text-decoration: none;
    background-color: #F1F5F9;
}

.footer__copyright__links a:focus {
    color: #0B1F3B !important;
    outline: 2px solid #0B1F3B;
    outline-offset: 2px;
}

/* Footer about logo */
.footer__about__logo a {
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: inline-block;
}

.footer__about__logo a:hover {
    opacity: 0.85;
    transform: scale(1.05);
}

/* Footer address links */
.footer__address ul li a {
    color: #64748B;
    transition: color 0.3s ease;
    text-decoration: none;
}

.footer__address ul li a:hover {
    color: #0B1F3B !important;
    text-decoration: none;
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
    .header, .footer, .btn, .primary-btn, .site-btn,
    .filter, .mobile-menu, nav {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

