/*
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: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
}

.header-left { 
    flex: 0 1 auto;
    margin-right: 0;
}

.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;
}

/* ============================================
   RIGHT SIDE NAVIGATION & USER
   ============================================ */

.header-right {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 0 1 auto;
}

.header-nav {
    display: flex !important;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
}

.header-nav.active {
    display: flex;
}

.nav-item-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--white);
    margin-left: auto;
}

.welcome-section { 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
}

.welcome-text { 
    color: var(--white);
    font-size: 14px;
    font-weight: 500;
}

.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,
.logout-btn {
    display: inline-flex;
    align-items: center;
    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,
.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 {
        gap: 10px;
    }

    .user-info {
        gap: 10px;
        padding-left: 10px;
    }
}

@media (max-width: 768px) {
    .header-content {
        min-height: 70px;
        gap: 15px;
    }

    .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;
    }

    .header-right {
        position: relative;
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }

    .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;
    }

    .user-info {
        flex-direction: column;
        width: 100%;
        gap: 8px;
        padding-left: 0;
        border-left: none;
    }

    .welcome-text {
        text-align: center;
        font-size: 12px;
    }

    .btn-logout,
    .logout-btn {
        width: 100%;
        justify-content: center;
    }

    .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,
    .logout-btn {
        padding: 9px 10px;
        font-size: 12px;
    }
}

/* ============================================
   CALCULATOR LAYOUT - MAIN CONTAINER
   ============================================ */

.calculator-wrapper {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    display: grid !important;
    grid-template-columns: 260px 1fr 320px !important;
    grid-gap: 0 !important;
    height: calc(100vh - 180px) !important;
}

.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;
}

/* ============================================
   MAP AND DIRECTIONS CONTAINERS
   ============================================ */

#directions-form {
    background: #f8fafc !important;
    padding: 25px !important;
    border-radius: 0 !important;
    border: none !important;
    border-right: 1px solid #e2e8f0 !important;
    display: block !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    height: 100% !important;
}

#map-container {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f0f4f8 !important;
    display: block !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    position: relative;
}

#dir-container {
    margin: 0 !important;
    padding: 20px !important;
    background: white !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-left: 1px solid #e2e8f0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: 100% !important;
    display: block !important;
    grid-column: 3 !important;
    grid-row: 1 !important;
    font-size: 13px;
}

.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: 400;
}

.error-message {
    padding: 15px;
    background: #fee;
    border: 2px solid #fcc;
    border-radius: 6px;
    color: #c33;
    font-weight: 500;
    margin-bottom: 20px;
}

/* ============================================
   ROUTE SUMMARY & RESULTS STYLING
   ============================================ */

.route-summary {
    background: #f8fafc !important;
    padding: 15px !important;
    border-bottom: 2px solid #e2e8f0 !important;
    margin-bottom: 15px !important;
    margin: -20px -20px 15px -20px !important;
    padding: 15px 20px !important;
}

.summary-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 6px 0 !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.summary-row:last-child {
    border-bottom: none !important;
}

.summary-label {
    font-weight: 600 !important;
    color: #475569 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.3px !important;
}

.summary-value {
    font-weight: 700 !important;
    color: #002855 !important;
    font-size: 13px !important;
}

/* ============================================
   DIRECTIONS STYLING
   ============================================ */

.directions {
    display: block;
}

.directions-title {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #002855 !important;
    margin: 0 0 12px 0 !important;
    border-bottom: 2px solid #10b981 !important;
    padding-bottom: 8px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.step {
    display: flex !important;
    gap: 10px !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}

.step:last-child {
    border-bottom: none !important;
}

.step-number {
    background: #002855 !important;
    color: white !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    flex-shrink: 0;
    line-height: 1;
}

.step-content {
    flex-grow: 1;
}

.step-instruction {
    font-weight: 600 !important;
    color: #002855 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    margin-bottom: 3px !important;
}

.step-distance {
    font-size: 11px !important;
    color: #10b981 !important;
    font-weight: 600 !important;
}

.directions-footer {
    margin-top: 15px !important;
    padding-top: 15px !important;
    border-top: 1px solid #e2e8f0 !important;
    text-align: center;
}

.return-to-top-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: #10b981 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
    background: rgba(16, 185, 129, 0.05) !important;
    border-radius: 4px !important;
    transition: all 0.2s ease !important;
}

.return-to-top-btn:hover {
    background: rgba(16, 185, 129, 0.1) !important;
    color: #059669 !important;
}

.return-icon {
    display: inline-block;
    transform: rotate(180deg);
}

/* ============================================
   PRINT BUTTON (STICKY AT TOP)
   ============================================ */

.results-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 12px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
    z-index: 100;
}

.print-route-btn {
    background: #4a90e2 !important;
    color: white !important;
    padding: 8px 16px !important;
    border: none !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    width: 100% !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.print-route-btn:hover {
    background: #3a7bc8 !important;
    transform: translateY(-1px) !important;
}

/* ============================================
   RESPONSIVE - TABLET (768px - 1199px)
   ============================================ */

@media (max-width: 1199px) {
    .calculator-wrapper {
        grid-template-columns: 240px 1fr 280px !important;
    }

    #directions-form {
        padding: 20px !important;
    }

    #dir-container {
        padding: 15px !important;
        font-size: 12px;
    }
}

@media (max-width: 900px) {
    .calculator-wrapper {
        grid-template-columns: 220px 1fr 240px !important;
        height: calc(100vh - 160px) !important;
    }

    #directions-form {
        padding: 18px !important;
    }

    .input-row input {
        font-size: 13px;
        padding: 10px 12px;
    }

    #go-button,
    #clear-button {
        max-width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }

    .units-row {
        gap: 20px;
    }
}

/* ============================================
   RESPONSIVE - MOBILE (< 768px)
   ============================================ */

@media (max-width: 767px) {
    .calculator-wrapper {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto 1fr !important;
        height: auto !important;
        min-height: calc(100vh - 180px) !important;
    }

    #directions-form {
        grid-column: 1 !important;
        grid-row: 1 !important;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0 !important;
        max-height: 35vh !important;
        overflow-y: auto !important;
        padding: 15px !important;
    }

    #map-container {
        grid-column: 1 !important;
        grid-row: 2 !important;
        height: 300px !important;
        min-height: 300px !important;
    }

    #dir-container {
        grid-column: 1 !important;
        grid-row: 3 !important;
        border-left: none !important;
        border-top: 1px solid #e2e8f0 !important;
        height: auto !important;
        max-height: 40vh !important;
        padding: 15px !important;
    }

    .calculator-title {
        font-size: 24px;
    }

    .input-row input {
        font-size: 16px;
        padding: 12px 15px;
    }

    #go-button,
    #clear-button {
        width: 100%;
        max-width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }

    .units-row {
        gap: 20px;
        margin: 15px 0;
    }
}

@media (max-width: 480px) {
    .calculator-wrapper {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    #directions-form {
        padding: 12px !important;
        max-height: 30vh !important;
    }

    #map-container {
        height: 250px !important;
        min-height: 250px !important;
    }

    #dir-container {
        padding: 12px !important;
        max-height: 35vh !important;
    }

    .calculator-title {
        font-size: 18px;
    }

    .input-row label {
        font-size: 12px;
    }

    .input-row input {
        font-size: 14px;
        padding: 10px 12px;
    }

    .input-example {
        font-size: 11px;
    }

    .button-row {
        margin-top: 15px;
    }

    #go-button,
    #clear-button {
        padding: 10px 15px;
        font-size: 13px;
    }
}