/* --- General Section Spacing Adjustment --- */
.calculator-section, .tools-section, .how-it-works-section, .manual-calc-section, .faq-section, .table-section, .author-section {
    padding: 30px 0;
}

.related-links-section {
    padding-top: 10px !important;
    padding-bottom: 15px !important;
}
.related-links-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.related-link-item {
    display: block;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    transition: all 0.3s ease;
}
.related-link-item:hover {
    border-color: var(--primary);
    background-color: #f7faff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* --- Added Hero Badges --- */
.hero-badges-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.hero-badge-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

        .checkbox-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            grid-column: 1 / -1;
            background: #f8fafc;
            padding: 0.75rem;
            border-radius: 8px;
        }

                .result-details { margin-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; text-align: left; }
        .result-item { background: #f8fafc; padding: 1rem; border-radius: 8px; border: 1px solid var(--border); }
        .result-item strong { display: block; color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.25rem; }
        .result-item span { font-weight: 600; font-size: 1.2rem; color: var(--text); }
        
/* --- Calculator Section --- */
.calculator-container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
}

.calculator-container h2 {
    text-align: center;
    font-size: 2.2rem;
    color: var(--dark);
    margin-bottom: 2rem;
}

.calculator-info {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

#workedHoursForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.form-group input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    margin-top: 10px;
}

.action-btn {
    flex-grow: 1;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: var(--primary);
    color: var(--white);
}

.action-btn.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.action-btn.secondary {
    background: #e2e8f0;
    color: #475569;
}

.action-btn.secondary:hover {
    background: #cbd5e1;
    transform: translateY(-2px);
}

#result-container {
    margin-top: 2rem;
    background: #f8fafc;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    border: 2px dashed #e2e8f0;
    display: none;
}

#result-container h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* --- Improved Section Heading & Paragraph UI --- */
.section-heading-decorated {
    text-align: center;
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-heading-decorated::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
}

.section-description-enhanced {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text);
    max-width: 850px;
    margin: 0 auto 3rem auto;
    line-height: 1.7;
}

/* --- Manual Calculation Section --- */
.manual-calc-section {
    background: var(--light);
}

.main-formula {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    text-align: center;
    max-width: 850px;
    margin: -1rem auto 3rem auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.main-formula p {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
    color: var(--text);
}

.main-formula code {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
}

.manual-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2rem;
}

.calculation-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.calculation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.calculation-card-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.calculation-card-header h4 {
    color: var(--primary);
    margin: 0;
    font-size: 1.2rem;
}

.calculation-card-body {
    padding: 1.5rem;
}

.calculation-card-body ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1rem;
}

.calculation-card-body li {
    margin-bottom: 0.5rem;
}

.calc-step {
    margin-top: 1rem;
}

.calc-step p {
    color: var(--text-light);
}

.calc-step code {
    display: block;
    background: #eef2ff;
    color: #4338ca;
    padding: 0.75rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    font-family: monospace;
    font-weight: 600;
    word-wrap: break-word;
}

/* --- Table Section --- */
.table-section {
    background: var(--white);
}

.table-info {
    max-width: 900px;
    margin: 2rem auto 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* --- **NEW** Responsive Table Wrapper --- */
.table-wrapper {
    max-width: 900px;
    margin: 0 auto;
    overflow-x: auto; /* This enables horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    border: 1px solid var(--border);
    border-radius: 12px;
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Force scrollbar if container is narrower */
}

.custom-table th, .custom-table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap; /* Prevent text from wrapping */
}

.custom-table thead {
    background: var(--dark);
    color: var(--white);
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:nth-child(even) {
    background-color: #f8fafc;
}

/* --- Author Card UI --- */
.author-section {
    background: #f8fafc;
}

.author-card {
    display: grid;
    grid-template-columns: 150px 1fr;
    max-width: 800px;
    margin: 1.5rem auto 0;
    align-items: center;
    gap: 2.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.07);
}

/* --- CORRECTED CLASS NAME --- */
.author-photo {
    position: relative;
    width: 150px;
    height: 150px;
}

/* --- CORRECTED CLASS NAME --- */
.author-photo::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    border-radius: 50%;
    z-index: 0;
}

.author-photo img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid white;
    position: relative;
    z-index: 1;
}

.author-name {
    font-size: 1.75rem;
    color: var(--dark);
    font-weight: 700;
    margin: 0;
}

.author-title {
    color: var(--primary);
    font-weight: 600;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.author-bio {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.author-social a {
    color: var(--text-light);
    font-size: 1.3rem;
    margin-right: 1.25rem;
    transition: all 0.3s ease;
}

.author-social a:hover {
    color: var(--primary);
    transform: scale(1.1);
}

/* STYLES MOVED FROM HTML */
.converter-block { 
    padding-top: 2rem; 
    margin-top: 2rem; 
    border-top: 2px dashed var(--border); 
}
.time-entry { 
    display: grid; 
    grid-template-columns: auto 1fr 1fr; 
    gap: 1rem; 
    align-items: center; 
    margin-bottom: 1rem; 
}
.time-entry .form-group { 
    margin-bottom: 0; 
}
#timeOperationForm { 
    display: block; 
}
.time-controls { 
    display: flex; 
    gap: 1rem; 
    margin-top: 1rem; 
    margin-bottom: 1.5rem; 
}
.operator-select { 
    padding: 0.8rem 0.5rem; 
    border: 1px solid var(--border); 
    border-radius: 8px; 
    font-size: 1.2rem; 
    font-weight: 600; 
    background-color: #f8fafc; 
}
.result-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); 
    gap: 1rem; 
    margin-top: 1rem; 
}
.result-box { 
    background: #f8fafc; 
    padding: 1rem; 
    border-radius: 8px; 
    text-align: center; 
}
.result-box label { 
    font-size: 0.9rem; 
    color: var(--text-light); 
}
.result-box input { 
    font-size: 1.5rem; 
    font-weight: 600; 
    color: var(--primary); 
    background: transparent; 
    border: none; 
    text-align: center; 
    padding: 0; 
    width: 100%; 
}

/* Style to make select dropdowns match input fields */
.form-group select {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 1rem;
            background-color: white;
            -webkit-appearance: none;
            appearance: none;
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
            background-position: right 0.5rem center;
            background-repeat: no-repeat;
            background-size: 1.5em 1.5em;
            transition: all 0.3s ease;
}
        .form-group select:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
        }

@media (max-width: 768px) {
    /* --- **NEW** Mobile Font Size Adjustment for Headings --- */
    .section-heading-decorated, .tools-section h2, .how-it-works-section h2, .faq-section h2, .author-section h2 {
        font-size: 2rem;
    }

    .author-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    /* --- CORRECTED CLASS NAME --- */
    .author-photo {
        margin: 0 auto;
        width: 120px;
        height: 120px;
    }
    .author-social {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .calculator-container {
        padding: 1.5rem 0.75rem;
    }

    .time-entry, .time-controls, .form-actions {
        display: grid;
        grid-template-columns: min-content 1fr 1fr;
        gap: 0.5rem;
    }

    .form-actions {
        margin-top: 10px;
    }

    .time-entry > span {
        width: auto !important;
    }
    
    #add-time-btn {
        grid-column: 1 / -1;
    }

    .form-actions .action-btn.primary {
        grid-column: 2 / 3;
    }

    .form-actions .action-btn.secondary {
        grid-column: 3 / 4;
    }

    .action-btn {
        width: 100%;
        padding: 0.8rem 0.2rem;
        font-size: 1rem;
        flex-grow: 0;
    }

    .time-entry .form-group input, .operator-select {
        font-size: 0.9rem;
        padding: 0.7rem 0.4rem;
    }

    .calculator-container h2 {
        font-size: 1.7rem;
    }
}