/*
Theme Name: Kadence Child - Wild Texas
Theme URI: https://wildtexas.com
Description: Kadence child theme for Wild Texas Travel Calculator
Author: Wild Texas
Author URI: https://wildtexas.com
Template: kadence
Version: 2.3 - ADOPTS TRAVEL-CALC PROVEN STYLES
Text Domain: kadence-child
*/

/* ============================================
   COLOR VARIABLES (UNIFIED - from travel-calc)
   ============================================ */
:root {
    --brand-navy: #002855;
    --brand-navy-light: #003875;
    --action-green: #10b981;
    --action-green-hover: #059669;
    --gold-accent: #FFD700;
    --trust-blue: #4a90e2;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-600: #475569;
    --gray-700: #334155;
    --shadow-sm: 0 1px 3px rgba(0,40,85,0.1);
    --shadow-md: 0 4px 6px rgba(0,40,85,0.1);
}

/* ============================================
   HEADER - UNIFIED (from travel-calc proven design)
   ============================================ */

.header-custom,
.header-bar,
.calc-minimal-header {
    background: var(--brand-navy);
    color: var(--white);
    padding: 18px 20px;
    box-shadow: var(--shadow-md);
    position: relative;
}

.header-custom::after,
.header-bar::after,
.calc-minimal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--action-green) 20%, var(--action-green) 80%, transparent);
    opacity: 0.7;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 30px;
    padding: 0 20px;
}

.header-left { 
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.header-left img, 
.header-logo {
    display: block; 
    object-fit: contain;
    border-radius: 4px;
    height: 50px;
    width: auto;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.header-logo-link:hover {
    opacity: 0.85;
}

.header-title { 
    margin: 0; 
    font-size: 1.4em; 
    color: var(--white); 
    font-weight: 700;
    letter-spacing: 0.5px;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.header-tagline {
    font-size: 0.85em;
    color: rgba(255, 255, 255, 0.7);
    display: none;
    font-weight: 400;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

/* ============================================
   CENTER NAVIGATION
   ============================================ */

.header-nav-center {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1 1 auto;
    justify-content: center;
    flex-wrap: nowrap;
    min-width: fit-content;
}

/* ============================================
   RIGHT SIDE NAVIGATION & USER
   ============================================ */

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
}

.header-nav {
    display: none !important;
}

.nav-item-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
}

.welcome-section { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.welcome-text { 
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
}

.tier-badge {
    color: var(--action-green);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
}

.tier-icon {
    font-size: 14px;
    line-height: 1;
}

.tier-badge-subtle {
    color: var(--white);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

/* ============================================
   BUTTONS - UNIFIED
   ============================================ */

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white);
    text-decoration: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    text-transform: capitalize;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--white);
    transform: translateY(-1px);
    text-decoration: none;
}

.nav-link-primary {
    background: transparent;
    border-color: var(--action-green);
    font-weight: 700;
    color: var(--white);
}

.nav-link-primary:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--action-green);
    text-decoration: none;
}

.btn-logout,
.btn-admin,
.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    color: var(--white);
    padding: 7px 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
}

.btn-logout:hover,
.btn-admin:hover,
.logout-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.6);
    color: var(--white);
    transform: translateY(-1px);
}

/* ============================================
   NAVIGATION DROPDOWNS
   ============================================ */

.header-mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--white);
    transition: transform 0.3s ease;
}

.header-mobile-toggle span {
    width: 24px;
    height: 2.5px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-arrow {
    width: 12px;
    height: 8px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.nav-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
}

.nav-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 2px;
    background: white;
    color: #333;
    min-width: 180px;
    border-radius: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    padding: 0;
    z-index: 1001;
    overflow: hidden;
}

.nav-menu.active,
.nav-item-wrapper:hover .nav-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu-item {
    display: block;
    padding: 12px 16px;
    color: #0073aa;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-menu-item:last-child {
    border-bottom: none;
}

.nav-menu-item:hover {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--brand-navy);
    padding-left: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 12px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.footer-custom {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    background: #f9f9f9;
    border-top: 1px solid #e0e0e0;
}

.footer-custom div {
    max-width: 100%;
    margin: 0 auto;
}

.footer-custom p {
    margin: 15px 0;
    line-height: 1.8;
}

.footer-sep {
    margin: 0 8px;
    color: #999;
}

.footer-copy {
    font-size: 14px;
    color: #666;
    margin-top: 15px !important;
}

.footer-custom a {
    color: #0073aa;
    text-decoration: underline;
}

.footer-custom a:hover {
    opacity: 0.8;
}

/* ============================================
   POST & PAGE TITLE FIXES
   ============================================ */

h1.entry-title,
h2.entry-title,
.entry-title {
    background: transparent !important;
    padding: 0 !important;
    color: #333 !important;
}

.page-title {
    background: transparent !important;
    color: #333 !important;
}

/* ============================================
   WILD TEXAS THEME CUSTOMIZATIONS
   ============================================ */

.site-header .site-branding .site-title {
    color: var(--brand-navy) !important;
    font-weight: bold;
}

.site-header .site-branding .site-title a {
    color: var(--brand-navy) !important;
    text-decoration: none;
}

.site-header .site-branding .site-description {
    color: #666666 !important;
    font-size: 14px;
}

.site-header nav.main-navigation a {
    color: var(--brand-navy) !important;
    padding: 8px 16px !important;
    border: 1px solid var(--brand-navy) !important;
    border-radius: 4px !important;
    display: inline-block !important;
    margin-right: 10px !important;
}

.site-header nav.main-navigation a:hover {
    background: var(--brand-navy) !important;
    color: white !important;
}

/* ============================================
   RESPONSIVE: TABLET & MOBILE
   ============================================ */

@media (max-width: 1024px) {
    .header-content {
        gap: 20px;
    }

    .header-nav-center {
        gap: 12px;
    }

    .user-info {
        gap: 10px;
        padding-left: 10px;
    }
}

@media (max-width: 768px) {
    .header-content {
        min-height: 70px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .header-left {
        flex: 0 1 auto;
    }

    .header-nav-center {
        order: 3;
        width: 100%;
        flex-basis: 100%;
        justify-content: flex-start;
        gap: 10px;
    }

    .header-right {
        order: 2;
        flex: 1 1 auto;
        gap: 8px;
    }

    .header-logo {
        height: 60px;
    }

    .header-title {
        font-size: 14px;
    }

    .header-tagline {
        font-size: 11px;
    }

    .header-mobile-toggle {
        display: flex;
    }

    .header-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        width: 100%;
        background: rgba(0, 40, 85, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding: 12px;
        gap: 8px;
        display: none;
        z-index: 998;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        backdrop-filter: blur(4px);
    }

    .header-nav.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
    }

    .nav-link-primary {
        order: -1;
    }

    .nav-menu {
        position: static;
        display: none;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.15);
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        margin-top: 6px;
        width: 100%;
    }

    .nav-menu.active {
        display: block;
    }

    .nav-menu-item {
        color: #b8d4e8;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 10px 12px;
    }

    .nav-menu-item:hover {
        background-color: rgba(16, 185, 129, 0.1);
        color: #e8f0f7;
        padding-left: 16px;
    }

    .header-user {
        flex-direction: row;
        width: auto;
        gap: 8px;
        padding-left: 0;
        border-left: none;
        flex-wrap: wrap;
    }

    .welcome-section {
        display: none;
    }

    .welcome-text {
        text-align: center;
        font-size: 12px;
    }

    .btn-logout,
    .btn-admin,
    .logout-btn {
        width: auto;
        padding: 6px 10px;
        font-size: 11px;
    }

    .footer-custom {
        margin-top: 40px;
        padding: 30px 15px;
    }
}

@media (max-width: 480px) {
    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .header-logo-link {
        gap: 8px;
    }

    .header-logo {
        height: 55px;
    }

    .header-title {
        font-size: 13px;
    }

    .header-tagline {
        font-size: 10px;
    }

    .nav-link,
    .btn-logout,
    .btn-admin,
    .logout-btn {
        padding: 9px 10px;
        font-size: 12px;
    }
}

/* ============================================
   MAP AND DIRECTIONS CONTAINERS
   ============================================ */

#map-container {
    width: 100%;
    height: 500px;
    margin-top: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 40, 85, 0.15);
    background: #f0f4f8;
}

#dir-container {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 40, 85, 0.1);
}

/* ============================================
   CALCULATOR FORM STYLING
   ============================================ */

.calculator-wrapper {
    max-width: 1000px;
    margin: 40px auto;
    padding: 40px 20px;
    background: white;
}

.calculator-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--brand-navy);
    margin: 0 0 10px 0;
    text-align: center;
}

.calculator-description {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin: 0 0 30px 0;
}

#directions-form {
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-row label {
    font-weight: 600;
    color: var(--brand-navy);
    font-size: 14px;
}

.input-row input {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.input-row input:focus {
    outline: none;
    border-color: var(--action-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-example {
    font-size: 12px;
    color: #999;
    font-style: italic;
}

.units-row {
    display: flex;
    gap: 30px;
    margin: 10px 0;
}

.units-row label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: #333;
}

.units-row input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.button-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 25px;
}

#go-button,
#clear-button {
    width: 100%;
    max-width: 300px;
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

#go-button {
    background: var(--action-green);
    color: white;
}

#go-button:hover:not(:disabled) {
    background: var(--action-green-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#go-button:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
}

#clear-button {
    background: #6b7280;
    color: white;
}

#clear-button:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

#loading-status {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: var(--action-green);
    font-weight: 500;
}

.error-message {
    padding: 15px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 6px;
    color: #c33;
    font-weight: 500;
    margin-bottom: 20px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .calculator-wrapper {
        margin: 20px auto;
        padding: 20px 15px;
    }

    #directions-form {
        padding: 20px;
    }

    .calculator-title {
        font-size: 24px;
    }

    #map-container {
        height: 400px;
    }
}

@media (max-width: 480px) {
    .calculator-wrapper {
        margin: 10px auto;
        padding: 15px 10px;
    }

    #directions-form {
        padding: 15px;
    }

    .calculator-title {
        font-size: 20px;
    }

    .units-row {
        gap: 15px;
    }

    #map-container {
        height: 300px;
    }
}