/* Custom Google-style Color Scheme */
:root {
    --primary-color: #4285F4; /* Google Blue */
    --secondary-color: #34A853; /* Google Green */
    --accent-color: #FBBC05; /* Google Yellow */
    --error-color: #EA4335; /* Google Red */
    --background-light: #f8f9fa;
    --background-dark: #ffffff;
    --text-color: #202124;
    --border-color: #dadce0;
    --card-shadow: 0 1px 3px 0 rgba(60,64,67,.3), 0 4px 8px 3px rgba(60,64,67,.15);
    --hover-shadow: 0 4px 6px 0 rgba(60,64,67,.2), 0 6px 10px 4px rgba(60,64,67,.1);
}



.logo img {
    max-height: 60px; /* Adjust the height based on your design */
    width: auto;      /* Maintain aspect ratio */
}





* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-light);
    padding-top: 60px; /* Space for fixed header */
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.main-header {
    background-color: var(--background-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 5px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px; /* Set a fixed height */
    padding: 0 10px; /* Horizontal padding */
}



.main-nav .nav-list {
    list-style: none;
    display: flex;
}

.main-nav .nav-list li {
    margin-left: 20px;
}

.main-nav .nav-list a {
    font-weight: 400;
    display: block;
    padding: 5px 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-color);
    cursor: pointer;
}

/* --- Main Content and Typography --- */
.content-area {
    padding: 40px 20px;
}

h2 {
    font-size: 1.8rem;
    margin-top: 30px;
    margin-bottom: 20px;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

/* --- Search Bar --- */
.search-bar {
    position: relative;
    max-width: 600px;
    margin: 20px auto 30px auto;
}

#calculator-search {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#calculator-search:focus {
    outline: none;
    border-color: var(--text-color);
    box-shadow: 0 1px 3px rgba(60,64,67,.3), 0 4px 8px rgba(60,64,67,.15);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--border-color);
}



/* --- Featured Calculator (Simple) --- */

/* --- Featured Calculator (Simple) --- */
.featured-calculator {
    background-color: #f9f9f9; /* Light background */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    margin-bottom: 40px;
    border: 1px solid #ddd; /* Light border */
}

.calculator-body {
    max-width: 380px; /* Increased width */
    margin: 20px auto;
    background-color: #ffffff; /* White background */
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); /* Slight shadow */
}

#calc-history {
    width: 100%;
    height: 40px; /* Slightly taller history bar */
    background-color: #f5f5f5; /* Lighter background for history */
    color: #333; /* Darker text for better readability */
    border: none;
    border-radius: 8px 8px 0 0;
    text-align: right;
    padding: 8px 10px;
    font-size: 1rem; /* Slightly larger font for history */
    box-sizing: border-box;
}

#calc-display {
    width: 100%;
    height: 70px; /* Taller display for better readability */
    background-color: #fafafa; /* Very light grey */
    color: #333; /* Dark text for readability */
    border: none;
    border-radius: 8px;
    text-align: right;
    padding: 10px;
    font-size: 2.5rem; /* Larger font for main display */
    margin-bottom: 20px; /* Increased margin */
    overflow-x: auto;
    white-space: nowrap;
}

/* Adjust buttons to match the light and modern theme */
.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px; /* Increased gap for a cleaner layout */
}

.btn {
    padding: 16px;
    font-size: 1.4rem; /* Larger text for buttons */
    border: none;
    border-radius: 10px; /* Rounded corners */
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-weight: 500;
    background-color: #f4f4f4; /* Light gray background */
    color: #333; /* Dark text for clarity */
}

.btn-num {
    background-color: #e4e4e4; /* Light grey for number buttons */
    color: #333;
}

.btn-op {
    background-color: #d6d6cc; /* Blue for operators */
    color: #fff;
}

.btn-op[data-action="clear"], .btn-op[data-action="backspace"] {
    background-color: #ff6347; /* Red for clear and backspace */
    color: #fff;
}

.btn-equal {
    background-color: #bdbdbd; /* Green for equals */
    color: #fff;
    grid-column: span 2; /* Takes up more space */
}

.wide {
    grid-column: span 2;
}

/* Hover and active states */
.btn:hover {
    background-color: #ddd; /* Slightly darker for hover */
}

.btn:active {
    transform: scale(0.98);
}

.btn-op:hover {
    background-color: #0056b3; /* Darker blue for hover on operator buttons */
}

.btn-op:active {
    background-color: #003a75; /* Darker blue when clicked */
}

.btn-equal:hover {
    background-color: #218838; /* Darker green for equals hover */
}

.btn-equal:active {
    background-color: #1e7e34; /* Even darker green on click */
}

/* Additional responsiveness */
@media (max-width: 600px) {
    .calculator-body {
        max-width: 100%;
        padding: 15px;
    }

    .calc-buttons {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }

    .btn {
        font-size: 1.1rem;
        padding: 14px;
    }
}




/* --- Calculator Grid --- */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding-bottom: 40px;
}

.calculator-card {
    background-color: var(--background-dark);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid var(--border-color);
}

.calculator-card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-5px);
    border-color: var(--text-color);
}

.calculator-card i {
    font-size: 3rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-color);
    margin-top: 5px;
}


/* --- PERCENTAGE CALCULATOR STYLES --- */
.percentage-calc-container {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-button {
    padding: 10px 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
    transition: all 0.2s;
}

.tab-button.active {
    border-bottom: 3px solid #d6d6cc; /* Primary color indicator */
    color: #d6d6cc;
    font-weight: bold;
}

/* --- CLS FIX: Absolute Positioning --- */

/* 1. The wrapper must be relative and define the fixed height */
.tab-content-wrapper {
    position: relative;
    width: 100%;
    /* Set a minimum height based on the tallest tab content to prevent collapse */
    min-height: 120px; 
}

/* 2. The tabs are positioned absolutely to overlap and exit the document flow */
.calc-tab {
    /* Set to absolute position relative to the wrapper */
    position: absolute; 
    top: 0;
    left: 0;
    width: 100%;

    /* Display as flex so content remains in a row */
    display: flex; 
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 0; /* Remove top/bottom padding here, handled by wrapper height */
    
    /* Transition for smooth fading */
    transition: opacity 0.3s ease-in-out;
}

/* Inactive (Hidden) Tabs */
.calc-tab.inactive {
    opacity: 0;
    pointer-events: none; /* Prevents clicking links/inputs in hidden tab */
    z-index: 1; /* Keep inactive tabs below the active one */
}

/* Active (Visible) Tab */
.calc-tab.active {
    opacity: 1;
    z-index: 10; /* Bring active tab to front */
}

/* Ensure input fields look good */
.calc-tab input[type="number"] {
    flex-grow: 1;
    max-width: 150px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.result-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    width: 100%; /* forces new line */
}

.result-box label {
    font-weight: bold;
    color: #333;
}

.result-box input[type="text"] {
    flex-grow: 1;
    padding: 10px;
    background: #e9ecef;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-weight: bold;
    color: #bdbdbd; /* Success color */
}



/* --- AESTHETIC IMPROVEMENTS --- */

/* 1. Make the main dart score inputs significantly larger and more impactful */
.dart-input {
    width: 120px; /* Increased width */
    padding: 15px; /* Increased padding */
    text-align: center;
    font-size: 1.8rem; /* Bolder font size */
    font-weight: 700;
    color: #004c99; /* Dark blue color for score entry */
    border: 3px solid #d6d6cc; /* Primary color border */
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
}

.dart-input:focus {
    border-color: #bdbdbd; /* Highlight green on focus */
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.4);
    outline: none;
}

/* 2. Improve Player Name input fields */
.player-setup input {
    flex-grow: 1;
    max-width: 250px;
    padding: 12px; /* Slightly larger padding */
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1.1rem; /* Clearer text */
}

/* 3. Style the information text section for better readability */
.info-text {
    background-color: #f7f9fc;
    border-left: 5px solid #d6d6cc;
    padding: 20px;
    border-radius: 8px;
    margin-top: 30px;
}

.info-text h3 {
    color: #004c99;
    border-bottom: 2px solid #e0eaf7;
    padding-bottom: 10px;
}

.info-text ul {
    list-style: disc;
    padding-left: 20px;
    margin-top: 15px;
}

.info-text li {
    margin-bottom: 8px;
}

/* Responsive adjustment for small screens to prevent overflow */
@media (max-width: 600px) {
    .dart-input {
        width: 100%;
        max-width: none;
    }
}



/* --- PATIO CALCULATOR STYLES --- */

.patio-calc-container {
    padding: 20px;
    background: #fcfcfc;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.patio-calc-container h3 {
    color: #d6d6cc;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px dashed #c0d9ff;
    padding-bottom: 5px;
}

/* Reusing .loan-input-group and .result-summary styles */
.patio-results .total-area {
    color: #bdbdbd; 
    font-size: 1.5rem;
    font-weight: 700;
}

/* --- Modern Select (Dropdown) Styling --- */
.patio-select {
    appearance: none; /* Removes default browser styling for a clean look */
    -webkit-appearance: none;
    -moz-appearance: none;
    /* Custom SVG arrow is injected here to replace the ugly default */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.8em;
    padding-right: 2.5rem; /* Make space for the custom arrow */
    
    /* Input Styling */
    width: 100%;
    padding: 10px;
    border: 2px solid #ccc;
    border-radius: 8px; /* Slightly more rounded corners */
    font-size: 1.1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.patio-select:hover {
    border-color: #d6d6cc;
}

.patio-select:focus {
    outline: none;
    border-color: #d6d6cc;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}


/* --- RING SIZE CONVERTER STYLES --- */

.ring-converter-container {
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.08);
    display: grid;
    gap: 20px;
}

@media (min-width: 640px) {
    /* Layout for two-column inputs */
    .ring-converter-container {
        grid-template-columns: 1fr 1fr;
    }
    .ring-input-group:nth-child(4) {
        grid-column: 1 / span 2; /* Make the fourth input span across */
    }
    #convert-btn {
        grid-column: 1 / span 2;
    }
    #result-output {
        grid-column: 1 / span 2;
    }
    #ring-error {
        grid-column: 1 / span 2;
    }
}

.ring-input-group {
    display: flex;
    flex-direction: column;
}

.ring-input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

/* Inherits the modern patio-select styling for dropdowns */
.ring-input-group .patio-select,
.ring-input-group input[type="number"] {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #cce5ff; /* Light blue border */
    border-radius: 6px;
    font-size: 1rem;
    background-color: #f8faff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ring-input-group input[type="number"]:focus {
    border-color: #d6d6cc;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
    outline: none;
}

/* Results Display Styling */
.patio-results {
    border: 2px solid #bdbdbd; /* Green border for success */
    border-radius: 8px;
    padding: 15px;
    background-color: #e2f0e6; /* Light green background */
    margin-top: 10px;
}
.patio-results h3 {
    color: #1a7a30; /* Darker green for title */
    border-bottom: 1px solid #a3e3b3;
}
.patio-results .total-area {
    color: #0d4a1b; /* Darkest green for the final size */
    font-size: 1.8rem;
}
.patio-results .summary-item {
    padding: 5px 0;
}



/* Icon Colors for Distinction */
.icon-simple { color: var(--text-color); }
.icon-scientific { color: var(--secondary-color); }
.icon-abacus { color: var(--accent-color); }
.icon-darts { color: var(--error-color); }
.icon-bmi { color: #5B2C6F; } /* Purple */
.icon-patio { color: #A93226; } /* Brown-Red */
.icon-ringsize { color: #9B59B6; }
.icon-length { color: #1ABC9C; }
.icon-percentage { color: #F39C12; }
.icon-volume { color: #34495E; }
.icon-weight { color: #16A085; }
.icon-lengthconv { color: #2980B9; }
.icon-speed { color: #C0392B; }
.icon-temperature { color: #E67E22; }
.icon-time { color: #2ECC71; }
.icon-weightconv { color: #7F8C8D; }

/* Tooltip Styling */
.tooltip-text {
    position: absolute;
    visibility: hidden;
    width: 200px;
    background-color: var(--text-color);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px 10px;
    z-index: 1;
    bottom: 100%; /* Position above the card */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.85rem;
    pointer-events: none;
}

.calculator-card:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Tooltip Arrow */
.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--text-color) transparent transparent transparent;
}

/* --- Calculator Pages Specific Styles (for calculators/*.html) --- */
.page-calculator-section {
    background-color: var(--background-dark);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    margin-bottom: 40px;
    max-width: 800px;
    margin: 40px auto;
}



/* --- LOAN CALCULATOR STYLES --- */

.loan-calc-container {
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.loan-input-group {
    margin-bottom: 15px;
}

.loan-input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    color: #333;
}

.loan-input-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1.1rem;
}

#calculate-loan-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Results Summary Box */
.loan-results h3 {
    margin-top: 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
    color: #d6d6cc;
}

.result-summary {
    background-color: #f1f1f1;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed #c0d9ff;
}

.summary-item:last-child {
    border-bottom: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 2px solid #d6d6cc;
}

.summary-item .label {
    font-weight: 400;
    color: #555;
}

.summary-item .value {
    font-weight: 600;
    color: #333;
}

.summary-item .monthly-payment {
    color: #bdbdbd; /* Highlight monthly payment */
    font-size: 1.2rem;
    font-weight: 700;
}

/* Amortization Table */
.amortization-schedule h3 {
    color: #333;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
    margin-top: 25px;
}

.table-container {
    max-height: 400px; /* Max height for scrollability */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 8px;
}

#schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: fixed;
}

#schedule-table th, #schedule-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

#schedule-table th {
    background-color: #d6d6cc;
    color: white;
    position: sticky; /* Sticky header for scrollable table */
    top: 0;
    z-index: 10;
    font-weight: 600;
}

#schedule-table tbody tr:nth-child(even) {
    background-color: #f4f7fa;
}

#schedule-table td:first-child {
    text-align: center;
    font-weight: bold;
    color: #555;
}




/* --- LENGTH CALCULATOR STYLES --- */

.length-calc-container {
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.length-calc-container .input-section {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 640px) {
    /* Three-column layout for inputs on desktop */
    .length-calc-container .input-section {
        grid-template-columns: repeat(3, 1fr); 
    }
}

.length-input-group {
    display: flex;
    flex-direction: column;
}

/* Reusing styling from ring and patio calculators for clean inputs */
.length-input-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
}

.length-input-group input[type="number"],
.length-input-group .patio-select {
    /* Consistent modern styling */
    padding: 10px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 1rem;
    background-color: white;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

#convert-length-btn {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    font-size: 1.1rem;
}




/* --- TEMPERATURE CONVERTER STYLES --- */

/* Applying specific styling to the result container used by the temperature converter */
/* We reuse .patio-results or the result output structure but ensure the border color is distinct (blue) */
.calculator-content #result-output {
    border-color: #d6d6cc; 
    border-left-width: 8px; /* Give it a noticeable blue highlight */
    margin-top: 1rem;
}

/* Styling for the unit label (like °C or K) inside the result span */
.result-value .unit-label {
    font-size: 1.25rem; /* Slightly smaller than the number */
    font-weight: 400;
    color: #4a5568; /* Gray color for contrast */
}

/* Ensure consistent look for temperature specific units */
.input-group select#from-unit,
.input-group select#to-unit {
    /* Using standard select styling from other converters */
    width: 100%;
}

/* Styling for the conversion icon between the two selects */
.conversion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 1.5rem;
    margin: 1rem 0;
}

/* Ensure mobile layout stacks inputs nicely */
.conversion-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* On tablets/desktop, lay them out side-by-side with the icon in the middle */
@media (min-width: 640px) {
    .conversion-options {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
    .conversion-options .input-group {
        flex: 1;
    }
    .conversion-icon {
        margin: 0 0.5rem;
    }
}







/* --- BASE FORM ELEMENT STYLING --- */

/* Input Group Container for Spacing */
.input-group {
    margin-bottom: 1.5rem;
    width: 100%; /* Ensures it takes full width of its parent */
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #4a5568; /* Slightly darker text for labels */
}

/* Base Styling for ALL Inputs and Selects (including temperature fields) */
.input-group input[type="number"],
.input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0; /* Light gray border */
    border-radius: 0.5rem; /* Rounded corners */
    font-size: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); /* Subtle shadow for depth */
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #ffffff; /* White background */
    -webkit-appearance: none; /* Remove default browser styling for select/number */
    -moz-appearance: none;
    appearance: none;
}

.input-group input[type="number"]:focus,
.input-group select:focus {
    border-color: #4f46e5; /* Purple focus color */
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3); /* Ring effect on focus */
    outline: none;
}

/* Specific styling for the Select element to add a dropdown arrow back */
.input-group select {
    /* Using a background SVG arrow to replace the default one */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M6 9l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem; /* Space for the custom arrow */
}

/* --- TEMPERATURE CONVERTER STYLES (Centering and Visibility Fix) --- */

/* 1. Centering Action Items and Results */
.converter-container #convert-btn,
.calculator-content #result-output {
    /* Ensures the element does not take full width, allowing margin:auto to center it */
    display: block; 
    margin-left: auto;
    margin-right: auto;
    /* Limit max width for better centering aesthetic on large screens */
    max-width: 400px; 
}

/* Fine-tune button centering */
.converter-container #convert-btn {
    width: auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Centering the inputs row for aesthetic symmetry */
.conversion-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 600px; /* Limit the width of the inputs */
    margin: 0 auto 1.5rem; /* Center the input group and add bottom margin */
}

/* 2. Visibility Enhancements for Result Output */
.calculator-content #result-output {
    /* Base styles for visual prominence */
    border-color: #d6d6cc; 
    border-left-width: 8px; 
    margin-top: 2rem; 
    text-align: center; 
    padding: 1.5rem; 
    background-color: #e6f3ff; /* Light blue background to stand out */
    border-radius: 0.75rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); /* More visible shadow */
}

.calculator-content #result-output p {
    font-size: 1rem;
    color: #4f46e5;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 2.5rem; /* Make the resulting number large and visible */
    font-weight: 700;
    color: #d6d6cc; /* Deep blue color */
    display: block;
}

.result-value .unit-label {
    font-size: 1.5rem; /* Make unit label large too */
    font-weight: 500;
    color: #0056b3; 
}

/* Layout for the conversion icon between the two selects (Mobile stacks, Desktop row) */
.conversion-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4f46e5;
    font-size: 1.5rem;
    margin: 1rem 0;
}

@media (min-width: 640px) {
    .conversion-options {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
    }
}
/* * NOTE: This is an illustrative block showing the necessary styles for the 
 * result container and is assumed to be appended to your existing style.css.
 * * If you have a complete style.css file, ensure these classes have these properties.
 */

/* --- Calculator Results Styling --- */

/* Base container for results section (often ID'd as result-output) */
.result-box, .patio-results, #result-output {
    margin-top: 20px;
    padding: 20px;
    background-color: #ecece5; /* Light blue background for emphasis */
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    /* CRITICAL FIXES FOR FLUID SIZE AND TEXT WRAPPING */
    /* 1. Allow the width to be determined by content, up to 100% of the parent */
    width: auto; 
    max-width: 100%;
}

/* Style for the main result text line (often ID'd as converted-result) */
#converted-result, .result-text {
    display: block; /* Ensures it acts as a block element */
   font-size: 1.5rem;
    font-weight: 700;
    color: #0c4a6e; /* Darker blue text */
    
    /* 2. Enforce wrapping for extremely long numbers */
    word-wrap: break-word; 
    white-space: normal; 
    overflow-wrap: break-word; /* Modern equivalent */
}

/* Ensure the number itself has appropriate wrapping properties */
#converted-result .result-value {
    display: inline-block; /* Allows wrapping within the span */
    /* Use monospace for numbers to prevent jagged alignment */
    font-family: 'Consolas', 'Monospace', monospace; 
}





/* --- AdSense Slots --- */
.adsense-slot {
    min-height: 100px; /* Placeholder minimum height */
    background-color: #eee;
    text-align: center;
    padding: 10px;
    margin: 30px 0;
    border: 1px dashed var(--border-color);
}

.adsense-slot p {
    color: #777;
    line-height: 80px;
}

/* --- Footer --- */
.main-footer {
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
}

.main-footer a {
    color: #fff;
    font-weight: 300;
}

/* --- Responsive Design (Mobile) --- */
@media (max-width: 768px) {
    .main-header .container {
        flex-wrap: wrap;
    }
    
    .logo {
        flex-grow: 1;
    }

    .menu-toggle {
        display: block;
    }

    .main-nav {
        width: 100%;
        order: 3; /* Push navigation below logo/toggle */
    }

    .main-nav .nav-list {
        flex-direction: column;
        width: 100%;
        display: none;
        background-color: var(--background-dark);
        border-top: 1px solid var(--border-color);
        position: absolute;
        top: 60px;
        left: 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        padding: 10px 0;
    }

    .main-nav .nav-list.active {
        display: flex;
    }

    .main-nav .nav-list li {
        margin: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-nav .nav-list li:last-child {
        border-bottom: none;
    }

    .main-nav .nav-list a {
        padding: 15px 20px;
        width: 100%;
    }

    .content-area {
        padding: 20px 10px;
    }

    .calculator-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .featured-calculator h2 {
        text-align: center;
    }

    /* Simple Calculator adjustments */
    #calc-display {
        font-size: 2rem;
        height: 50px;
    }
    .btn {
        padding: 12px;
        font-size: 1rem;
    }
    
    .wide {
        grid-column: span 2;
    }
}