* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-bg: #ecf0f1;
    --border-color: #bdc3c7;
    --text-color: #2c3e50;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.description {
    font-size: 0.95rem;
    opacity: 0.85;
    margin-top: 10px;
    line-height: 1.5;
}

main {
    padding: 30px;
}

.form-section {
    margin-bottom: 30px;
}

.relief-section .section-header {
    cursor: pointer;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.relief-section .section-header:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.relief-section .section-header h2 {
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    border: none;
    padding: 0;
}

.section-hint {
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

.toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.toggle-icon.rotated {
    transform: rotate(-180deg);
}

.relief-inputs {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.relief-inputs.expanded {
    max-height: 3000px;
}

/* Ensure relief inputs work well on mobile */
@media (max-width: 768px) {
    .relief-inputs.expanded {
        max-height: 4000px;
    }
}

.form-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-bg);
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary-color);
}

.max-amount {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: normal;
    font-style: italic;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.help-text {
    display: block;
    margin-top: 5px;
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
}

.quick-presets {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.preset-label {
    margin: 0 0 10px 0;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.preset-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-preset {
    padding: 8px 16px;
    background: white;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-preset:hover {
    background: var(--secondary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.btn-calculate {
    flex: 2;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-calculate:active {
    transform: translateY(0);
}

.btn-reset {
    flex: 1;
    padding: 15px;
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset:hover {
    background: var(--light-bg);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-clear {
    width: 100%;
    padding: 10px;
    margin-top: 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.results {
    margin-top: 30px;
    padding: 25px;
    background: var(--light-bg);
    border-radius: 10px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results.hidden {
    display: none;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.results-header h2 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.8rem;
}

.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-share {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.btn-snapshot {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-snapshot:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.4);
}

.result-grid {
    display: grid;
    gap: 15px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.result-item.highlight {
    border-left-color: var(--success-color);
    background: #e8f8f5;
}

.result-label {
    font-weight: 600;
    color: var(--primary-color);
}

.result-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.tax-amount {
    color: var(--danger-color);
    font-size: 1.5rem;
}

footer {
    padding: 20px 30px;
    background: var(--light-bg);
    text-align: center;
    font-size: 0.9rem;
    color: #7f8c8d;
}

footer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

.developer-credit {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #bdc3c7;
}

.footer-nav {
    margin-top: 10px;
    font-size: 0.85rem;
}

.footer-nav a {
    color: var(--secondary-color);
    text-decoration: none;
    margin: 0 5px;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-weight: 600;
}

/* Tax Bracket Table Styles */
.tax-bracket-section {
    margin-bottom: 30px;
}

.tax-bracket-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.tax-bracket-content.expanded {
    max-height: 2000px;
}

.bracket-info {
    background: #fff3cd;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    margin-bottom: 20px;
}

.bracket-info p {
    margin: 8px 0;
    color: var(--text-color);
    font-size: 0.95rem;
}

.table-responsive {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tax-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 0.95rem;
}

.tax-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tax-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #5a67d8;
}

.tax-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.tax-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tax-table td {
    padding: 12px 15px;
    text-align: left;
}

.tax-table tbody tr.active-bracket {
    background: #d4edda;
    border-left: 4px solid #28a745;
    font-weight: 600;
}

.tax-table tbody tr.partial-bracket {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
}

.tax-table tbody tr.zero-rate {
    background: #f0f0f0;
    color: #6c757d;
}

.bracket-range {
    font-weight: 600;
    color: var(--primary-color);
}

.tax-rate {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary-color);
}

.tax-amount {
    font-weight: 600;
    color: var(--success-color);
}

.cumulative-tax {
    font-weight: 700;
    color: var(--danger-color);
}

.bracket-legend {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-color {
    width: 30px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.legend-color.active-bracket {
    background: #d4edda;
    border-color: #28a745;
}

.legend-color.partial-bracket {
    background: #fff3cd;
    border-color: #ffc107;
}

/* Relief Summary Styles */
.relief-summary {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 10px;
    animation: slideIn 0.5s ease;
}

.relief-summary.hidden {
    display: none;
}

.relief-summary h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.utilization-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.utilization-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 4px solid var(--secondary-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.utilization-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.utilization-card.potential {
    border-left-color: var(--warning-color);
}

.utilization-card.savings {
    border-left-color: var(--success-color);
}

.card-icon {
    font-size: 2.5rem;
}

.card-content h3 {
    margin: 0 0 8px 0;
    font-size: 0.95rem;
    color: #7f8c8d;
    font-weight: 600;
}

.big-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.recommendations {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid var(--warning-color);
}

.recommendations h3 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.recommendation-item {
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #ffc107;
}

.recommendation-item:last-child {
    margin-bottom: 0;
}

.recommendation-item h4 {
    margin: 0 0 8px 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.recommendation-item p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
}

.recommendation-item .savings-highlight {
    display: inline-block;
    background: var(--success-color);
    color: white;
    padding: 3px 10px;
    border-radius: 5px;
    font-weight: 600;
    margin-top: 8px;
}

.relief-tips {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
}

.relief-tips h3 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.relief-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.relief-tips li {
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
    color: var(--text-color);
    line-height: 1.6;
}

.relief-tips li:last-child {
    border-bottom: none;
}

.relief-tips li strong {
    color: var(--secondary-color);
}

/* FAQ Section */
.faq-section {
    margin-top: 30px;
    padding: 25px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.faq-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-align: center;
}

.faq-item {
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.faq-item h3 {
    color: var(--primary-color);
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.faq-item p {
    margin: 0;
    color: var(--text-color);
    line-height: 1.6;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    header {
        padding: 20px 15px;
    }
    
    header h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .description {
        font-size: 0.85rem;
        line-height: 1.5;
    }
    
    main {
        padding: 15px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .form-section h2 {
        font-size: 1.3rem;
    }
    
    input[type="number"] {
        font-size: 16px !important; /* Prevent zoom on iOS */
        padding: 14px;
    }
    
    label {
        font-size: 0.95rem;
    }
    
    .help-text {
        font-size: 0.8rem;
    }
    
    .max-amount {
        font-size: 0.75rem;
        display: block;
        margin-top: 2px;
    }
    
    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 15px;
    }
    
    .result-label {
        font-size: 0.9rem;
    }
    
    .result-value {
        font-size: 1.3rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .btn-calculate,
    .btn-reset {
        width: 100%;
        flex: none;
        padding: 16px;
        font-size: 1rem;
    }
    
    .preset-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .btn-preset {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .btn-clear {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .results-header h2 {
        font-size: 1.4rem;
    }
    
    .share-buttons {
        width: 100%;
        gap: 10px;
    }
    
    .btn-share {
        flex: 1;
        padding: 12px 10px;
        font-size: 0.85rem;
        min-width: auto;
    }
    
    .tax-bracket-section,
    .content-section,
    .faq-section {
        padding: 20px 15px;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    .section-hint {
        font-size: 0.85rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        scroll-behavior: smooth;
    }
    
    .tax-table {
        font-size: 0.75rem;
        min-width: 100%;
    }
    
    .tax-table th,
    .tax-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }
    
    .bracket-legend {
        flex-direction: column;
        gap: 10px;
    }
    
    .legend-item {
        font-size: 0.85rem;
    }
    
    .utilization-overview {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .utilization-card {
        padding: 15px;
    }
    
    .big-number {
        font-size: 1.4rem;
    }
    
    .faq-item {
        padding: 15px;
    }
    
    .faq-item h3 {
        font-size: 1rem;
        line-height: 1.4;
    }
    
    .faq-item p {
        font-size: 0.9rem;
    }
    
    .guide-section h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .guide-section > h3 {
        font-size: 1.1rem;
        line-height: 1.4;
    }
    
    .guide-article {
        padding: 20px 15px;
        margin: 20px 0;
    }
    
    .guide-article h3 {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .guide-article h4 {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .guide-article p {
        font-size: 0.9rem;
    }
    
    .highlight-box,
    .relief-detail {
        padding: 15px;
        margin: 15px 0;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tip-card {
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }
    
    .tip-icon {
        font-size: 2.8rem;
        padding: 20px 15px 12px;
    }
    
    .tip-content {
        padding: 15px;
    }
    
    .tip-card h4 {
        font-size: 1.05rem;
        margin-bottom: 12px;
    }
    
    .tip-text {
        gap: 10px;
    }
    
    .tip-malay {
        padding: 10px;
        font-size: 0.9rem;
        line-height: 1.6;
    }
    
    .tip-english {
        padding: 10px;
        font-size: 0.85rem;
        line-height: 1.6;
    }
    
    .date-item {
        flex-direction: column;
        padding: 15px;
        gap: 10px;
    }
    
    .date-badge {
        width: 100%;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .date-info strong {
        font-size: 0.95rem;
    }
    
    .date-info p {
        font-size: 0.85rem;
    }
    
    .mistake-item {
        padding: 15px;
    }
    
    .mistake-item h4 {
        font-size: 0.95rem;
    }
    
    .mistake-item p {
        font-size: 0.85rem;
    }
    
    .contact-info {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-card {
        padding: 15px;
    }
    
    .contact-card h4 {
        font-size: 1rem;
    }
    
    .contact-card p {
        font-size: 0.85rem;
    }
    
    .table-responsive {
        margin: 15px -15px; /* Extend to edges */
    }
    
    .info-table {
        font-size: 0.75rem;
    }
    
    .info-table th,
    .info-table td {
        padding: 8px 6px;
    }
    
    /* Income type cards mobile optimization */
    .income-types-container {
        gap: 12px;
    }
    
    .income-type-card {
        padding: 15px;
    }
    
    .income-type-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .income-type-header h5 {
        font-size: 0.95rem;
        min-width: auto;
        width: 100%;
    }
    
    .status-badge {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .income-type-card p {
        font-size: 0.85rem;
    }
    
    footer {
        padding: 20px 15px;
        font-size: 0.85rem;
    }
    
    .footer-nav {
        font-size: 0.8rem;
        line-height: 1.8;
    }
    
    .footer-nav a {
        display: inline-block;
        padding: 5px 8px;
    }
}

/* Extra small devices (phones in portrait, less than 576px) */
@media (max-width: 576px) {
    body {
        padding: 5px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .btn-share {
        width: 100%;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .tax-table {
        font-size: 0.7rem;
    }
    
    .tax-table th,
    .tax-table td {
        padding: 6px 4px;
    }
    
    /* Tips cards for very small screens */
    .tips-grid {
        gap: 15px;
    }
    
    .tip-icon {
        font-size: 2.5rem;
        padding: 18px 12px 10px;
    }
    
    .tip-content {
        padding: 12px;
    }
    
    .tip-card h4 {
        font-size: 1rem;
    }
    
    .tip-malay,
    .tip-english {
        padding: 8px;
        font-size: 0.85rem;
    }
}

/* Specific optimization for 360-375px width screens (Samsung Galaxy A series, etc.) */
@media (max-width: 380px) {
    body {
        padding: 3px;
    }
    
    .container {
        border-radius: 8px;
    }
    
    header {
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.3rem;
        line-height: 1.2;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .description {
        font-size: 0.8rem;
        line-height: 1.4;
    }
    
    main {
        padding: 10px;
    }
    
    .form-section {
        padding: 15px 10px;
        margin: 15px 0;
    }
    
    .form-section h2 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    input[type="number"] {
        font-size: 16px !important;
        padding: 12px 10px;
    }
    
    .help-text {
        font-size: 0.75rem;
    }
    
    .quick-presets {
        margin: 15px 0;
    }
    
    .preset-label {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .btn-preset {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .button-group {
        gap: 10px;
    }
    
    .btn-calculate {
        padding: 14px;
        font-size: 0.95rem;
    }
    
    .btn-reset {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .btn-clear {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .section-hint {
        font-size: 0.8rem;
    }
    
    .toggle-icon {
        font-size: 1rem;
    }
    
    .results {
        padding: 15px 10px;
    }
    
    .results-header h2 {
        font-size: 1.3rem;
    }
    
    .result-grid {
        gap: 12px;
    }
    
    .result-item {
        padding: 12px;
    }
    
    .result-label {
        font-size: 0.85rem;
    }
    
    .result-value {
        font-size: 1.2rem;
    }
    
    .share-buttons {
        gap: 8px;
    }
    
    .btn-share {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .tax-bracket-section,
    .content-section,
    .faq-section {
        padding: 15px 10px;
    }
    
    .guide-section h2 {
        font-size: 1.4rem;
    }
    
    .guide-section > h3 {
        font-size: 1rem;
    }
    
    .guide-article {
        padding: 15px 10px;
        margin: 15px 0;
    }
    
    .guide-article h3 {
        font-size: 1.15rem;
    }
    
    .guide-article h4 {
        font-size: 0.95rem;
    }
    
    .guide-article p,
    .guide-article ul,
    .guide-article li {
        font-size: 0.85rem;
    }
    
    .highlight-box,
    .relief-detail {
        padding: 12px;
        margin: 12px 0;
    }
    
    .tips-grid {
        gap: 12px;
    }
    
    .tip-icon {
        font-size: 2.3rem;
        padding: 15px 10px 8px;
    }
    
    .tip-content {
        padding: 10px;
    }
    
    .tip-card h4 {
        font-size: 0.95rem;
        margin-bottom: 10px;
    }
    
    .tip-text {
        gap: 8px;
    }
    
    .tip-malay,
    .tip-english {
        padding: 8px;
        font-size: 0.8rem;
        line-height: 1.5;
    }
    
    .date-item {
        padding: 12px;
    }
    
    .date-badge {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .date-info strong {
        font-size: 0.9rem;
    }
    
    .date-info p {
        font-size: 0.8rem;
    }
    
    .mistake-item {
        padding: 12px;
    }
    
    .mistake-item h4 {
        font-size: 0.9rem;
    }
    
    .mistake-item p {
        font-size: 0.8rem;
    }
    
    .income-type-card {
        padding: 12px;
    }
    
    .income-type-header h5 {
        font-size: 0.9rem;
    }
    
    .status-badge {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .income-type-card p {
        font-size: 0.8rem;
    }
    
    .contact-card {
        padding: 12px;
    }
    
    .contact-card h4 {
        font-size: 0.95rem;
    }
    
    .contact-card p {
        font-size: 0.8rem;
    }
    
    .faq-item {
        padding: 12px;
    }
    
    .faq-item h3 {
        font-size: 0.95rem;
    }
    
    .faq-item p {
        font-size: 0.85rem;
    }
    
    .utilization-card {
        padding: 12px;
    }
    
    .big-number {
        font-size: 1.3rem;
    }
    
    footer {
        padding: 15px 10px;
        font-size: 0.8rem;
    }
    
    .footer-nav {
        font-size: 0.75rem;
    }
    
    .footer-nav a {
        padding: 4px 6px;
    }
    
    .table-responsive {
        margin: 10px -10px;
    }
    
    .tax-table {
        font-size: 0.65rem;
    }
    
    .tax-table th,
    .tax-table td {
        padding: 5px 3px;
    }
    
    .floating-simulator-btn {
        bottom: 10px;
        right: 10px;
        padding: 8px 12px;
    }
    
    .float-icon {
        font-size: 1.6rem;
    }
}

/* Landscape orientation optimization */
@media (max-height: 600px) and (orientation: landscape) {
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .subtitle,
    .description {
        font-size: 0.8rem;
    }
    
    .form-section {
        padding: 15px;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    button,
    .btn-preset,
    .btn-calculate,
    .btn-reset,
    .btn-share,
    .btn-clear {
        min-height: 44px; /* Apple's recommended touch target size */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    input[type="number"] {
        min-height: 44px;
    }
    
    .section-header {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
    }
}

/* Content Section Styles */
.content-section {
    background: white;
    padding: 40px;
    margin: 30px 0;
}

.guide-section h2 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 10px;
    text-align: center;
}

.guide-section > h3 {
    color: var(--secondary-color);
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 30px;
    font-weight: normal;
}

.guide-article {
    background: var(--light-bg);
    padding: 30px;
    margin: 30px 0;
    border-radius: 10px;
    border-left: 5px solid var(--secondary-color);
}

.guide-article h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.guide-article h4 {
    color: var(--secondary-color);
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.guide-article p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.highlight-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--warning-color);
    margin: 20px 0;
}

.highlight-box h4 {
    color: var(--warning-color);
    margin-bottom: 15px;
}

.highlight-box ul {
    list-style: none;
    padding-left: 0;
}

.highlight-box li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.highlight-box li:last-child {
    border-bottom: none;
}

.relief-detail {
    background: white;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.relief-detail h4 {
    color: var(--success-color);
    margin-bottom: 10px;
}

.relief-detail p {
    margin-bottom: 10px;
}

.important-dates {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.date-item {
    display: flex;
    gap: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    align-items: flex-start;
}

.date-badge {
    background: var(--danger-color);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

.date-info {
    flex: 1;
}

.date-info strong {
    color: var(--primary-color);
    display: block;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .tips-grid {
        grid-template-columns: 1fr;
    }
}

.tip-card {
    background: white;
    padding: 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.tip-icon {
    font-size: 3.5rem;
    padding: 25px 20px 15px;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.tip-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tip-card h4 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-size: 1.15rem;
    font-weight: 600;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.tip-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    min-width: 0;
}

.tip-malay {
    margin: 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid var(--secondary-color);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.tip-english {
    margin: 0;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid #95a5a6;
    font-size: 0.9rem;
    line-height: 1.7;
    color: #555;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.tip-english strong {
    color: var(--primary-color);
}

.mistake-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mistake-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--danger-color);
}

.mistake-item h4 {
    color: var(--danger-color);
    margin-bottom: 10px;
}

.mistake-item p {
    margin-bottom: 8px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.info-table thead {
    background: var(--primary-color);
    color: white;
}

.info-table th,
.info-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.info-table tbody tr:hover {
    background: var(--light-bg);
}

.info-table .taxable {
    color: var(--success-color);
    font-weight: bold;
}

.info-table .non-taxable {
    color: var(--danger-color);
    font-weight: bold;
}

.info-table .conditional {
    color: var(--warning-color);
    font-weight: bold;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.contact-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--secondary-color);
}

.contact-card h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.contact-card p {
    margin-bottom: 10px;
}

.contact-card a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}

.contact-card a:hover {
    text-decoration: underline;
}

/* Income Types Card Layout (Mobile-First Design) */
.income-types-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.income-type-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.income-type-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.income-type-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.income-type-header h5 {
    color: var(--primary-color);
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    flex: 1;
    min-width: 200px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.status-badge.taxable {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-badge.non-taxable {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-badge.conditional {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.income-type-card p {
    margin: 0;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Desktop: Show as grid */
@media (min-width: 769px) {
    .income-types-container {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 20px;
    }
    
    .income-type-header h5 {
        font-size: 1.1rem;
    }
}

/* Floating Simulator Button */
.floating-simulator-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    z-index: 1000;
    animation: floatPulse 3s ease-in-out infinite;
}

.floating-simulator-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.6);
}

.float-icon {
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

.float-text {
    white-space: nowrap;
}

@keyframes floatPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Mobile adjustments for floating button */
@media (max-width: 768px) {
    .floating-simulator-btn {
        bottom: 20px;
        right: 20px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .float-icon {
        font-size: 1.3rem;
    }
    
    .float-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .floating-simulator-btn {
        bottom: 15px;
        right: 15px;
        padding: 10px 15px;
        border-radius: 40px;
    }
    
    .float-text {
        display: none;
    }
    
    .float-icon {
        font-size: 1.8rem;
        margin: 0;
    }
}
