/* =======================================
   CSS VARIABLES & MODERN RESET
======================================= */
:root {
    --hd-primary: #225F75;
    --hd-primary-dark: #1b4e61;
    --hd-accent: #e67e22;
    --hd-bg: #f8fafc;
    --hd-card-bg: #ffffff;
    --hd-text-main: #334155;
    --hd-text-muted: #64748b;
    --hd-border: #e2e8f0;
    --hd-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --hd-radius: 12px;
}

/* =======================================
   DASHBOARD CONTAINER
======================================= */
.hd-dashboard {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Inter', -apple-system, sans-serif;
    color: var(--hd-text-main);
    background-color: var(--hd-bg);
}

/* =======================================
   USER INFO CARD
======================================= */
.hd-user-info {
    background: var(--hd-card-bg);
    padding: 24px;
    border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.hd-user-info strong {
    color: var(--hd-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
}

/* =======================================
   TAB NAVIGATION
======================================= */
.hd-tab-nav {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px;
    border-radius: 10px;
    margin-bottom: 30px;
    width: fit-content;
}

.hd-tab-btn {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--hd-text-muted);
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hd-tab-btn:hover {
    color: var(--hd-primary);
}

.hd-tab-btn.active {
    background: #fff;
    color: var(--hd-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* =======================================
   LAYOUT CONTAINERS
======================================= */
.hd-layout-container {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 40px;
    align-items: start;
}

.hd-chart-visual {
    background: var(--hd-card-bg);
    padding: 30px;
    border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow);
    position: sticky;
    top: 20px;
}

/* =======================================
   TABLES
======================================= */
.hd-fields-table, 
.astro-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--hd-card-bg);
    border-radius: var(--hd-radius);
    overflow: hidden;
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow);
}

.hd-fields-table th, 
.astro-table th {
    background: #f8fafc;
    color: var(--hd-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
    padding: 16px;
    border-bottom: 1px solid var(--hd-border);
}

.hd-fields-table td, 
.astro-table td {
    padding: 16px;
    border-bottom: 1px solid var(--hd-border);
    font-size: 15px;
}

.hd-fields-table tr:hover, 
.astro-table tr:hover {
    background-color: #f1f5f9;
}

/* =======================================
   BUTTONS & ACTIONS
======================================= */
.hd-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.hd-buttons form, 
.hd-buttons #ft-button-container {
    margin: 0;
    display: inline-block;
}

.hd-buttons .hd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    min-width: 200px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hd-buttons form:nth-child(1) .hd-btn {
    background-color: #4a5568;
    color: #ffffff;
}

.hd-buttons form:nth-child(2) .hd-btn {
    background-color: #2d3748;
    color: #ffffff;
}

#ft-checkout-btn {
    background-color: #1a73e8 !important;
    color: #ffffff;
}

.hd-buttons .hd-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    opacity: 0.9;
}

.full-report-btn {
    background: #0A9BC3;
    color: #ffffff;
    padding: 18px 35px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(98, 0, 234, 0.3);
}

.full-report-btn:hover {
    background: #284B64;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(98, 0, 234, 0.4);
}

.hd-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--hd-primary);
    border: 2px solid var(--hd-primary);
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    outline: none;
    margin-top: 20px;
}

.hd-btn-outline:hover {
    background-color: var(--hd-primary);
    color: #ffffff !important;
    box-shadow: 0 8px 15px rgba(34, 95, 117, 0.2);
    transform: translateY(-2px);
}

.hd-btn-outline:active {
    transform: translateY(0);
    box-shadow: none;
}

.hd-btn-outline::before {
    content: '←';
    margin-right: 8px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.hd-btn-outline:hover::before {
    transform: translateX(-3px);
}

/* =======================================
   FORM WRAPPER & FIELDS
======================================= */
.hd-chart-form-wrapper {
    max-width: 650px;
    margin: 40px auto;
    background: #ffffff;
    padding: 40px;
    border-radius: var(--hd-radius);
    border: 1px solid var(--hd-border);
    box-shadow: var(--hd-shadow);
}

.hd-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hd-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--hd-text-main);
    margin-bottom: 8px;
}

.hd-form input[type="text"],
.hd-form input[type="email"],
.hd-form input[type="datetime-local"],
.hd-form select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--hd-border);
    border-radius: 8px;
    background-color: #f8fafc;
    color: var(--hd-text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.hd-form input:focus {
    outline: none;
    border-color: var(--hd-primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(34, 95, 117, 0.1);
}

.hd-inline-fields {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.hd-inline-fields select {
    flex: 1;
    min-width: 0;
}

/* =======================================
   CHECKBOX & CONFIRMATION
======================================= */
.hd-confirm-label {
    background: #f1f5f9;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: var(--hd-text-muted) !important;
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.hd-confirm-label:hover {
    background: #e2e8f0;
}

.hd-confirm-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--hd-primary);
}

/* =======================================
   LOCATION AUTOCOMPLETE
======================================= */
label:has(#hd_location) {
    position: relative;
}

.hd-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--hd-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    max-height: 250px;
    overflow-y: auto;
    z-index: 999;
}

.hd-suggestion-item {
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.hd-suggestion-item:last-child {
    border-bottom: none;
}

.hd-suggestion-item:hover {
    background: #f8fafc;
    color: var(--hd-primary);
}

/* =======================================
   SUBMIT BUTTON
======================================= */
.hd-form button[type="submit"] {
    width: 100%;
    background-color: var(--hd-primary);
    color: #fff;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    box-shadow: rgba(34, 95, 117, 0.2) 0 4px 9px;
}

.hd-form button[type="submit"]:hover {
    background-color: var(--hd-primary-dark);
    transform: translateY(-2px);
    box-shadow: rgba(34, 95, 117, 0.3) 0 8px 15px;
}

.hd-form button[type="submit"]:active {
    transform: translateY(0);
}

/* =======================================
   BODYGRAPH SVG
======================================= */
.bodygraph-svg {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: block;
}

.bodygraph-svg svg {
    width: 100% !important;
    height: auto !important;
}

.bodygraph-svg-scaled {
    max-width: 300px;
    margin: 0 auto;
}

.bodygraph-svg-scaled svg {
    width: 100% !important;
    height: auto !important;
}

/* =======================================
   FULL REPORT GRID (Always in One Row)
======================================= */
.hd-full-grid {
    display: flex;
    flex-wrap: nowrap; /* Forces everything on one line */
    justify-content: center; /* Centers everything */
    align-items: flex-start;
    gap: 5px; /* Much tighter spacing */
}

.hd-planet-col {
    flex: 0 0 auto; /* Only takes space it needs */
    min-width: 0;
}

.hd-chart-center {
    flex: 0 0 auto; /* SVG only takes space it needs */
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hd-planetary-table {
    width: 100%;
    border-collapse: collapse;
}

.hd-planetary-table td {
    padding: 8px 2px;
    border: none !important;
    font-size: 1.1rem;
    vertical-align: middle;
}

/* =======================================
   PLANETARY COLORS & ALIGNMENT
======================================= */
.design-col { 
    color: #d32f2f; 
}

.design-col .symbol { 
    font-size: 1.3rem; 
}

.design-col .gate-val { 
    font-weight: bold; 
    padding-left: 8px; 
    text-align: left; 
}

.personality-col { 
    color: #222; 
}

.personality-col .symbol { 
    font-size: 1.3rem; 
    text-align: right; 
}

.personality-col .gate-val { 
    font-weight: bold; 
    padding-right: 8px; 
    text-align: right; 
}

.arrow-val { 
    width: 12px; 
    font-size: 0.9rem; 
    font-weight: 900;
    color: #94a3b8;
}

/* =======================================
   RESPONSIVE: DESKTOP (1101px+)
======================================= */
@media (min-width: 1101px) {
    .hd-full-report-cta {
        grid-column: 1 / -1;
        margin-top: 20px;
    }
}

/* =======================================
   RESPONSIVE: TABLET (768px - 1100px)
======================================= */
@media (max-width: 1100px) {
    .hd-layout-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .hd-chart-visual {
        position: static;
        order: 2;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        padding: 15px;
    }

    .hd-results-content {
        order: 1;
        width: 100%;
    }

    .hd-full-report-cta {
        order: 3;
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

/* =======================================
   RESPONSIVE: MOBILE (max-width: 768px)
======================================= */
@media (max-width: 768px) {
    .hd-inline-fields {
        flex-direction: column;
        gap: 5px;
    }

    /* Keep everything in one row, just make it smaller */
    .hd-full-grid {
        gap: 2px;
    }

    .hd-planetary-table td {
        font-size: 0.7rem;
        padding: 3px 1px;
    }

    .col-title {
        font-size: 11px;
        text-align: center;
        margin-bottom: 5px;
    }

    .bodygraph-svg-scaled {
        max-width: 200px; /* Much smaller SVG on mobile */
    }

    .symbol {
        font-size: 0.9rem !important;
    }

    .gate-val {
        font-size: 0.7rem !important;
    }

    .arrow-val {
        font-size: 0.7rem !important;
    }
}

/* =======================================
   RESPONSIVE: SMALL MOBILE (max-width: 600px)
======================================= */
@media (max-width: 600px) {
    .hd-user-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .hd-tab-nav {
        width: 100%;
        overflow-x: auto;
    }

    .hd-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hd-buttons .hd-btn {
        width: 100%;
        max-width: 300px;
    }
}

/* =======================================
   RESPONSIVE: EXTRA SMALL (max-width: 480px)
======================================= */
@media (max-width: 480px) {
    .hd-chart-form-wrapper {
        padding: 25px 20px;
        margin: 20px;
    }
    
    .hd-form button[type="submit"] {
        font-size: 16px;
    }
}
