:root {
    /* Professional Construction/Tools Theme */
    --brand-primary: #f59e0b;
    /* Vibrant Orange */
    --brand-hover: #d97706;
    --brand-dark: #b45309;

    --bg-nav: #1e293b;
    /* Dark Navbar */
    --bg-hero-overlay: rgba(30, 41, 59, 0.85);
    /* Dark Blue/Slate Overlay */
    --bg-body: #ffffff;
    --bg-card: #f8fafc;

    --text-primary: #1e293b;
    /* Slate 800 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --text-inverse: #ffffff;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-body);
    font-family: var(--font-body);
    color: var(--text-primary);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navbar */
.navbar {
    background-color: var(--bg-nav);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 800;
    font-family: var(--font-heading);
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin-left: auto;
    /* Push to right */
    margin-right: 2rem;
}

.nav-link {
    color: #cbd5e1;
    /* Slate 300 */
    font-weight: 600;
    font-size: 1rem;
    transition: color 0.2s;
    font-family: var(--font-heading);
}

.nav-link:hover {
    color: white;
}

.nav-link.active {
    color: var(--brand-primary);
}

/* Mobile Nav Hide */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

.logo-icon {
    background: #fff;
    color: #1e293b;
    padding: 4px;
    border-radius: 4px;
    display: flex;
}

/* Hero Section */
.hero-section {
    position: relative;
    background-image: url('https://images.unsplash.com/photo-1552664730-d307ca884978?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    /* Calculator Theme */
    background-size: cover;
    background-position: center;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-hero-overlay);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-content h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta {
    background-color: var(--brand-primary);
    color: white;
    font-weight: 800;
    padding: 1rem 2.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: inline-block;
}

.hero-cta:hover {
    background-color: var(--brand-hover);
    transform: translateY(-2px);
}

/* Catalogue / Tools Section */
.category-section {
    padding: 4rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header-centered {
    text-align: center;
    margin-bottom: 4rem;
}

.badge-catalogue {
    background-color: var(--brand-primary);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Tools Grid Override */
/* Tools Grid Override */
/* Tools Grid Override */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 4rem;
    /* Increased gap */
    align-items: stretch;
}

.category-row {
    margin-bottom: 3rem;
}

/* Tool Card Redesign */
.tool-card {
    background: #ffffff;
    border: 1px solid var(--brand-primary);
    /* Orange border as shown */
    border-radius: 12px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Align top */
    height: 100%;
    box-shadow: none;
    /* Flat look based on screenshot */
    min-height: 320px;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.2);
}

.card-img {
    width: 96px;
    height: 96px;
    margin-bottom: 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    background: #fff7ed;
    /* Light orange/beige background */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 16px;
    /* Padding for the icon inside */
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure icon isn't cut off */
    transition: transform 0.3s;
}

.card-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-grow: 1;
}

.card-info h4 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #1e293b;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.tool-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 90%;
}

.try-btn {
    display: block;
    width: 100%;
    background-color: var(--brand-primary);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: auto;
    /* Push to bottom */
}

.try-btn:hover {
    background-color: var(--brand-hover);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 4rem;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--text-secondary);
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.page-link.active {
    background-color: var(--brand-primary);
    color: white;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

.page-link:hover:not(.active) {
    background-color: #f1f5f9;
}

/* Footer */
footer {
    background-color: #0f172a;
    /* Dark Slate 900 */
    color: #94a3b8;
    /* Slate 400 */
    padding: 4rem 5% 2rem;
    margin-top: 4rem;
    font-size: 0.95rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
    text-align: left;
    /* Override center alignment */
}

.footer-column h3 {
    color: white;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

.footer-brand span {
    color: white;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.2rem;
    display: block;
    margin-bottom: 1rem;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column li {
    margin-bottom: 0.8rem;
}

.footer-column a {
    color: #94a3b8;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: var(--brand-primary);
}

.footer-bottom {
    max-width: 1400px;
    margin: 0 auto;
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.85rem;
}

/* Mobile */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }
}

/* Hide theme toggle/lang switch for this strict professional look if desired, or keep minimal */
#theme-toggle {
    display: none;
}

/* Categories visible now */
.category-header {
    margin-top: 3rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 1rem;
    width: 100%;
    grid-column: 1 / -1;
}

.category-header h3 {
    color: #0f172a;
    font-size: 1.5rem;
}

/* Tool Page Layout */
.tool-page {
    padding: 3rem 5%;
    min-height: 80vh;
    background-color: var(--bg-body);
}

.tool-container {
    max-width: 800px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-header h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.tool-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.icon-wrapper {
    background: var(--brand-primary);
    color: white;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 4px 6px rgba(245, 158, 11, 0.3);
}

/* Calculator Card Section */
.calc-section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow-card);
}

/* Form Elements */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.input-wrapper {
    display: flex;
    align-items: stretch;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.input-wrapper:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.input-wrapper input {
    flex-grow: 1;
    border: none;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
    /* Prevent overflow */
}

/* Modern Select Styling */
.input-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    border: none;
    padding: 0 2.5rem 0 1rem;
    /* Space for arrow */
    font-size: 1rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
    height: 100%;
    outline: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    background-size: 1rem;
}

/* Distinguish Unit Selectors (small, side-car) from Main Selectors */
.input-wrapper input+select,
.input-wrapper input+.unit-text {
    width: auto;
    background-color: #f8fafc;
    border-left: 1px solid #cbd5e1;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    padding-right: 2rem;
}

/* Fix for pure text units */
.input-wrapper .unit-text {
    padding-right: 1rem;
    background-image: none;
}

/* Ensure full height for selects in wrapper */
.input-wrapper {
    min-height: 50px;
    /* Ensure sufficient touch target/visual height */
    position: relative;
    background: #ffffff;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background-color: var(--brand-primary);
    color: white;
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 1rem;
    display: block;
}

.calculate-btn:hover {
    background-color: var(--brand-hover);
}

/* Results Area */
.result-grid,
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.result-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
}

.result-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.2;
}

.result-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Explainer Section */
.explainer-section {
    margin-top: 4rem;
    text-align: left;
}

.explainer-section h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.explainer-content {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--shadow-card);
}

.explainer-content h3 {
    color: var(--brand-primary);
    font-family: var(--font-heading);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.explainer-content p,
.explainer-content ul {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.explainer-content ul {
    list-style-position: inside;
    margin-left: 1rem;
}

.explainer-content li {
    margin-bottom: 0.5rem;
}

/* Mobile Responsive For Tools */
@media (max-width: 640px) {

    .result-grid,
    .results-grid {
        grid-template-columns: 1fr;
    }

    .input-grid {
        grid-template-columns: 1fr;
    }

    .tool-grid-inputs {
        grid-template-columns: 1fr;
    }
}

/* Tool Cover */
.tool-cover {
    width: 100%;
    height: 250px;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.tool-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.3) 100%);
}

.hidden {
    display: none !important;
}

/* ========================================
   CUBIC YARD CALCULATOR SPECIFIC STYLES
   ======================================== */

/* Quick Presets */
.quick-presets {
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.quick-presets>span {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
    margin-right: 0.5rem;
}

.preset-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.preset-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Canvas Container */
.canvas-container {
    width: 100%;
    height: 200px;
    background: #ffffff;
    border-radius: 12px;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #e2e8f0;
    overflow: hidden;
    position: relative;
}

#volume-canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.action-buttons.justify-start {
    justify-content: flex-start;
}

.btn-secondary {
    background: #f8fafc;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-size: 1rem;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Advanced Panel */
#advanced-panel {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border: 1px dashed #e2e8f0;
    border-radius: 8px;
}

#advanced-panel small {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

/* Result Cards - Specific Styling */
.result-card.primary {
    background: #fff7ed;
    border-color: #fed7aa;
}

.result-card.primary .result-value {
    color: #ea580c;
    font-size: 2.5rem;
}

.result-card.primary .result-label {
    color: #9a3412;
}

/* Cost Box */
#cost-box {
    margin-top: 1rem;
    background: #ecfccb;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #d9f99d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#cost-box span:first-child {
    font-weight: 600;
    color: #365314;
}

#total-cost {
    font-weight: 800;
    font-size: 1.5rem;
    color: #166534;
}

/* Bag Calculator */
.bag-calculator {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-top: 2rem;
}

.bag-calculator h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 700;
}

.bag-calculator>div {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.bag-calculator label {
    font-weight: 600;
    color: #64748b;
}

.bag-calculator select {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: white;
    color: #1e293b;
}

#bags-needed {
    font-weight: 700;
    color: var(--brand-primary);
    font-size: 1.2rem;
}

/* Material Comparison Table */
.material-comparison {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.material-comparison h3 {
    margin-bottom: 1rem;
    color: var(--brand-primary);
    font-family: var(--font-heading);
    font-weight: 700;
}

.material-comparison p {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
}

.material-table {
    width: 100%;
    border-collapse: collapse;
}

.material-table thead tr {
    background: #e2e8f0;
}

.material-table th,
.material-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.material-table th {
    font-weight: 700;
    color: #1e293b;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.material-table td {
    color: #64748b;
    font-weight: 500;
}

/* History List */
.history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    color: #64748b;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item span {
    font-size: 0.9rem;
}

.history-item strong {
    color: var(--brand-primary);
    font-weight: 700;
}

/* Error Messages */
.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: none;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    color: transparent !important;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    max-width: 300px;
}

.toast-success {
    border-left: 4px solid #10b981;
    color: #065f46;
}

.toast-error {
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* Accessibility Improvements */
*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* ARIA Live Regions */
[aria-live="polite"],
[aria-live="assertive"] {
    position: relative;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .quick-presets {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        justify-content: center;
    }

    .toast {
        right: 1rem;
        left: 1rem;
        bottom: 1rem;
        max-width: none;
    }

    .material-table {
        font-size: 0.85rem;
    }

    .material-table th,
    .material-table td {
        padding: 0.5rem;
    }
}

/* Date Calculator Styles (Adapted) */
:root {
    --primary: #d946ef;
    --primary-dark: #c026d3;
    --primary-light: #fff7ed;
    --secondary: #f59e0b;
    --text-dark: #1e293b;
    --surface: #ffffff;
    --bg: #ffffff;
}

body {
    background-color: var(--bg);
}

.tool-page .tool-container {
    max-width: 900px;
    background: var(--surface);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(192, 38, 211, 0.15);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.tool-cover {
    height: 220px;
    position: relative;
}

.tool-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(245, 158, 11, 0.1), rgba(255, 255, 255, 1));
    backdrop-filter: blur(2px);
}

.tool-header {
    text-align: center;
    padding: 0 2rem 2rem;
    position: relative;
    z-index: 1;
    margin-top: -70px;
}

.tool-header .icon-wrapper {
    background: white;
    width: 90px;
    height: 90px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--primary);
    box-shadow: 0 10px 30px -5px rgba(245, 158, 11, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.tabs-header {
    display: flex;
    background: #fff7ed;
    padding: 0.5rem;
    border-radius: 18px;
    margin: 0 2rem 2.5rem;
    border: 1px solid rgba(253, 186, 116, 0.2);
}

.tab-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    font-family: var(--font-heading);
    font-weight: 600;
    color: #b45309;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 14px;
}

.tab-btn:hover {
    color: var(--primary-dark);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.1);
    transform: scale(1.02);
}

.unit-select {
    padding: 0.6rem 1rem;
    border-radius: 12px;
    border: 2px solid #fed7aa;
    background-color: white;
    font-size: 0.95rem;
    color: #334155;
    outline: none;
    transition: all 0.2s;
    cursor: pointer;
    font-family: var(--font-body);
}

.unit-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.result-toolbar {
    animation: fadeIn 0.4s ease-out;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    font-weight: 700;
    color: #b45309;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 1.1rem;
    border: 2px solid #fed7aa;
    border-radius: 14px;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.2s;
    background: white;
    color: #1e293b;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.calculate-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    width: 100%;
    padding: 1.25rem;
    border: none;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.15rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
    letter-spacing: 0.02em;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px -5px rgba(245, 158, 11, 0.5);
}

.result-panel {
    background: white;
    border: 1px solid #f0f0f0;
    border-radius: 20px;
    padding: 2.5rem;
    margin-top: 3rem;
    display: none;
    box-shadow: 0 20px 40px -10px rgba(245, 158, 11, 0.1);
    position: relative;
    overflow: hidden;
}

.result-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

.result-panel.show {
    display: block;
    animation: popIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.res-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: flex-start;
}

@media (max-width: 768px) {
    .res-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.res-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.res-val {
    font-size: 2.5rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #d97706, #b45309);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.res-subtitle {
    font-size: 1.2rem;
    color: #64748b;
    margin-top: 0.5rem;
    font-weight: 500;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    border: 1px solid rgba(240, 171, 252, 0.3);
    transition: background 0.2s;
}

.toggle-switch:hover {
    background: white;
    border-color: #fbbf24;
}

.toggle-switch input {
    width: 1.4rem;
    height: 1.4rem;
    accent-color: var(--primary);
}


/* Date Calculator Utility Classes */
.no-overflow-pad {
    padding: 0 !important;
    overflow: hidden;
}

.calc-section-pad {
    padding: 2rem;
}

.btn-purple {
    background: #d97706 !important;
}

.res-val-lg {
    font-size: 1.2rem !important;
}

.alt-list {
    list-style: none;
    padding: 0;
    color: #1e293b;
}

.biz-warning {
    font-size: 0.85rem;
    color: #b45309;
    margin-top: 0.5rem;
    display: none;
}

.text-center {
    text-align: center;
}

.custom-faq {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.faq-title {
    text-align: center;
    color: #b45309;
}

.faq-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.faq-question {
    color: #d97706;
    margin-bottom: 0.5rem;
}

.faq-answer {
    color: #475569;
}

/* Distance Calculator Specifics */
.bg-distance {
    background-image: url('images/distance-cover.svg');
}

.action-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-secondary {
    background: white;
    border: 2px solid #e2e8f0;
    color: #64748b;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    color: #475569;
    background: #f8fafc;
}

.copy-btn {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    background: #e0f2fe;
}

/* Tool Cover Image Fix */
.tool-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Distance Calculator Specific Styles (Orange Theme) */
.point-inputs {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

.point-card {
    background: #fff7ed;
    /* Orange 50 */
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #fed7aa;
    /* Orange 200 */
    text-align: center;
    flex: 1;
    min-width: 250px;
}

.point-title {
    font-family: var(--font-heading, sans-serif);
    font-size: 1.2rem;
    color: #b45309;
    /* Orange 700 */
    margin-bottom: 1rem;
    font-weight: 700;
}

.coord-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.input-coord {
    width: 80px;
    padding: 0.8rem;
    border: 2px solid #fed7aa;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    background: white;
    transition: all 0.2s;
    color: #1e293b;
}

.input-coord:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.coord-label {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.steps-container {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #fed7aa;
    text-align: left;
}

.step-row {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #475569;
    background: #fff7ed;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid #fed7aa;
}

.step-math {
    font-family: monospace;
    font-size: 1.15rem;
    display: block;
    margin-top: 0.5rem;
    color: #b45309;
    font-weight: 600;
}

/* Date Calculator Responsive Overrides */
@media (max-width: 768px) {
    .tool-page .tool-container {
        border-radius: 0;
        margin: 0;
        min-height: 100vh;
        box-shadow: none;
        padding-bottom: 4rem;
        /* Space for mobile nav if applicable */
    }

    .tool-header {
        margin-top: 0;
        padding: 2rem 1rem 1rem;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-cover {
        height: 180px;
    }

    .icon-wrapper {
        margin-top: -40px;
    }

    /* Stack inputs on small screens */
    .input-grid {
        grid-template-columns: 1fr;
    }

    /* Center align input groups if wanted or keep left? Standard is left. */

    /* Result Panel */
    .res-val {
        font-size: 2.5rem;
        /* Smaller than 4rem */
    }

    /* FAQ padding */
    .custom-faq {
        margin: 2rem auto;
        padding: 0 1rem;
    }
}

/* Map Calculator Specifics & SEO Article Styles */
#map {
    z-index: 0;
}

@media (max-width: 768px) {
    #map {
        height: 60vh;
    }
}

.seo-section {
    max-width: 900px;
    margin: 0 auto;
    padding: 4rem 1.5rem;
    color: var(--text-primary);
}

.seo-heading-main {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--brand-dark);
    margin-bottom: 1.5rem;
}

.seo-intro {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.how-to-box {
    background: #fff7ed;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 3rem;
    border: 1px solid #fed7aa;
}

.how-to-title {
    color: #b45309;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.how-to-list {
    list-style-type: none;
    padding: 0;
}

.how-to-step {
    margin-bottom: 0.8rem;
    display: flex;
    gap: 0.8rem;
}

.step-number {
    background: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #f59e0b;
    border: 1px solid #f59e0b;
    flex-shrink: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.feature-title {
    color: #0f172a;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-desc {
    font-size: 0.95rem;
    color: #64748b;
}

.faq-q-title {
    color: #ea580c;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.faq-a-text {
    color: #475569;
}

/* --- New Calculator Styles --- */

/* Input Grid System */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

/* Calculator Action Buttons */
.remove-row-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-row-btn:hover {
    color: #b91c1c;
    background: #fef2f2;
    border-radius: 6px;
}

/* Style Toggle Switch */
.unit-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1rem;
    gap: 10px;
}

.unit-toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.unit-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.unit-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 34px;
}

.unit-toggle-slider:before {
    /* Knob styling */
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.unit-toggle-switch input:checked+.unit-toggle-slider {
    background-color: #f59e0b;
}

.unit-toggle-switch input:checked+.unit-toggle-slider:before {
    transform: translateX(24px);
}

/* ========================================
   DISTANCE CALCULATOR SPECIFIC STYLES
   ======================================== */

.toolbar-container {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.unit-label {
    font-weight: 500;
    color: #4b5563;
}

.unit-select-custom {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.graph-container {
    margin: 2rem 0;
    text-align: center;
}

.graph-canvas {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    max-width: 100%;
}

.graph-caption {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 0.5rem;
}

.action-buttons-container {
    justify-content: center;
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.toggle-steps-btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
}

.article-container {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 1rem;
    color: #334155;
    line-height: 1.8;
}

.article-header {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 2rem;
    margin-bottom: 2.5rem;
}

.article-title {
    font-size: 2.25rem;
    color: #0f172a;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
}

.article-intro {
    font-size: 1.125rem;
    color: #64748b;
}

.formula-box {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #6366f1;
    margin: 1.5rem 0;
    font-family: monospace;
    font-size: 1.1rem;
    overflow-x: auto;
}

.formula-box-3d {
    border-left-color: #8b5cf6;
}

.application-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.app-card {
    background: #fff;
    padding: 1.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.example-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.more-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.tool-link-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
    transition: transform 0.2s;
}

.tool-link-card:hover {
    transform: translateY(-2px);
}

.calculator-interface {
    padding: 0 2rem 3rem;
}

.swap-btn-custom {
    align-self: center;
    margin: 1rem;
    padding: 0.75rem !important;
    border-radius: 50%;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    color: #3b82f6;
    cursor: pointer;
    transition: all 0.2s;
}

.swap-btn-custom:hover {
    background: #dbeafe;
}

.share-btn-custom {
    background: #e0f2fe;
    color: #0284c7;
    border-color: #bae6fd;
}

/* Angel Number Meaning Tables */
.meaning-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 1.05rem;
}

.meaning-table th,
.meaning-table td {
    border: 1px solid #e2e8f0;
    padding: 1rem;
    text-align: left;
}

.meaning-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Cinzel', serif;
}

.meaning-table tr:nth-child(even) {
    background: #fdfdfd;
}