/* Main Styles for FM 200 Calculator - Updated Color Scheme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ff4c4c;      /* Red - Main brand color */
    --primary-dark: #cc0000; /* Darker red for hover */
    --secondary: #0099e5;    /* Blue - Secondary color */
    --tertiary: #34bf49;     /* Green - Success/Info color */
    --dark: #000000;         /* Black - Text and backgrounds */
    --light: #f8f9fa;        /* Light background */
    --gray: #5f6368;         /* Gray text */
    --gray-light: #dadce0;   /* Light gray borders */
    --warning: #ff9800;      /* Warning color */
    --danger: #ff4444;       /* Danger color */
    --border-radius: 8px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* Dark Theme Variables */
.dark-mode {
    --dark: #ffffff;
    --light: #1a1a1a;
    --gray: #b0b0b0;
    --gray-light: #444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    transition: background 0.3s ease;
}

.dark-mode body {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.main-header {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    padding: 20px;
    transition: var(--transition);
}

.dark-mode .main-header {
    background: #2d2d2d;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: var(--primary);
}

.logo h1 {
    color: var(--primary);
    margin: 0;
    font-size: 2rem;
}

.tagline {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.visitor-counter {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--secondary);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 153, 229, 0.3);
}

.btn-icon {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

/* Navigation */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
    flex-wrap: wrap;
}

.main-nav a {
    text-decoration: none;
    color: var(--gray);
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 5px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.main-nav a:hover, .main-nav a.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 5px rgba(255, 76, 76, 0.3);
}

/* Main Calculator Layout */
.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 992px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }
}

/* Panel Styles */
.panel {
    background: white;
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.dark-mode .panel {
    background: #2d2d2d;
}

.panel:hover {
    box-shadow: var(--shadow-hover);
}

.panel-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
}

.panel-icon {
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.5rem;
}

.panel-header h2 {
    font-size: 1.5rem;
    color: var(--primary);
    flex-grow: 1;
}

/* Form Styles */
.form-section {
    margin-bottom: 25px;
    padding: 20px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    background: var(--light);
}

.dark-mode .form-section {
    background: #333;
}

.form-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.form-row.three-col .form-group {
    flex: 1 1 33%;
}

.form-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.form-group label {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

input[type="text"], input[type="number"], input[type="email"], input[type="tel"], input[type="date"], select, textarea {
    padding: 12px 15px;
    border: 2px solid var(--gray-light);
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
    width: 100%;
    min-height: 44px;
    background: white;
    color: var(--dark);
}

.dark-mode input,
.dark-mode select,
.dark-mode textarea {
    background: #444;
    color: white;
    border-color: #555;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 76, 76, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 76, 76, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #0077cc;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 153, 229, 0.3);
}

.btn-info {
    background: var(--tertiary);
    color: white;
}

.btn-info:hover {
    background: #2aa83f;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 191, 73, 0.3);
}

.action-section {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-light);
    justify-content: flex-end;
}

/* Preview Panel Styles */
.preview-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    display: flex;
    align-items: center;
    background: var(--light);
    padding: 20px;
    border-radius: var(--border-radius);
    border-left: 5px solid var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.dark-mode .stat-card {
    background: #333;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-right: 20px;
}

.stat-info p {
    margin: 0;
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    display: block;
}

/* Accordion Info Box */
.info-box-wrapper {
    margin-bottom: 20px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.accordion-item {
    border-bottom: 1px solid var(--gray-light);
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    cursor: pointer;
    background: var(--light);
    transition: background 0.3s;
}

.dark-mode .accordion-header {
    background: #333;
}

.accordion-header:hover {
    background: rgba(255, 76, 76, 0.1);
}

.info-icon {
    color: var(--primary);
    font-size: 1.2rem;
    margin-right: 15px;
}

.info-title {
    font-weight: 600;
    flex-grow: 1;
    color: var(--dark);
}

.accordion-icon {
    font-size: 0.8rem;
    transition: transform 0.3s;
    color: var(--gray);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.accordion-item.active .accordion-content {
    max-height: 500px;
    padding: 20px;
}

.accordion-content p {
    margin-bottom: 0;
    font-size: 0.95rem;
    color: var(--gray);
    line-height: 1.6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    margin: auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

.dark-mode .modal-content {
    background: #2d2d2d;
    color: white;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--gray-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary);
}

.close-modal {
    color: var(--gray);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary);
}

.modal-body {
    padding: 20px;
}

.modal-body p {
    margin-bottom: 15px;
    color: var(--gray);
    line-height: 1.5;
}

/* Expert Mode Toggle */
.expert-toggle-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    background: rgba(255, 76, 76, 0.1);
    border: 1px solid rgba(255, 76, 76, 0.2);
}

.expert-toggle-section span {
    color: var(--dark);
    font-weight: 600;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
}

input:checked + .slider {
    background-color: var(--tertiary);
}

input:focus + .slider {
    box-shadow: 0 0 1px var(--tertiary);
}

input:checked + .slider:before {
    transform: translateX(30px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

.expert-mode-panel {
    display: none;
    margin-top: 15px;
    padding-top: 20px;
    border-top: 2px dashed var(--primary);
}

/* Disclaimer Section */
.disclaimer-section {
    text-align: center;
    padding: 20px;
    background: rgba(255, 76, 76, 0.1);
    color: var(--dark);
    border: 1px solid rgba(255, 76, 76, 0.3);
    border-radius: var(--border-radius);
    margin-top: 30px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.disclaimer-section i {
    color: var(--primary);
    font-size: 1.2rem;
}

/* Footer Styles */
.main-footer {
    background: var(--dark);
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
}

/* Tools Links Section */
.tool-links-section {
    padding-bottom: 40px;
    margin-bottom: 30px;
    border-bottom: 1px solid #3c4043;
}

.affiliate-area {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.affiliate-button {
    padding: 12px 25px;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    border: none;
    min-height: 44px;
}

.affiliate-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.amazon-button {
    background: #ff9900;
    box-shadow: 0 2px 5px rgba(255, 153, 0, 0.5);
}

.amazon-button:hover {
    background: #e68a00;
}

.coffee-button {
    background: #ffdd00;
    color: #3c2a1c;
    box-shadow: 0 2px 5px rgba(255, 221, 0, 0.5);
}

.coffee-button:hover {
    background: #e6c800;
}

.explore-tools-area h3 {
    text-align: center;
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 30px;
    font-weight: 700;
}

.tools-category {
    margin-bottom: 40px;
}

.tools-category h4 {
    color: var(--secondary);
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 10px;
}

.other-tools-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.other-tools-list li {
    background: #3c4043;
    border-radius: var(--border-radius);
    padding: 20px;
    transition: all 0.3s ease;
    border-left: 5px solid var(--tertiary);
}

.other-tools-list li:hover {
    background: #4a4d50;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.other-tools-list a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.other-tools-list a i {
    color: var(--tertiary);
}

.tool-description {
    font-size: 0.85rem;
    color: #bdbdbd;
    margin: 5px 0 0 0;
    padding-left: 24px;
    line-height: 1.5;
}

/* Footer Details */
.footer-details {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 0;
    border-top: 1px solid #3c4043;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 30px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    flex: 1;
}

.footer-links a {
    color: #bdbdbd;
    text-decoration: none;
    transition: color 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    justify-content: center;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.social-links a:hover {
    color: var(--primary);
    background: rgba(255, 76, 76, 0.2);
    transform: scale(1.1);
}

.contact-info {
    color: var(--secondary);
    font-weight: 500;
    text-align: right;
    flex: 1;
}

.contact-info i {
    margin-right: 10px;
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #3c4043;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #bdbdbd;
}

.footer-disclaimer {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 68, 68, 0.1);
    padding: 10px;
    border-radius: 5px;
}

.footer-disclaimer i {
    color: var(--danger);
    font-size: 1.2rem;
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 400px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.notification-success {
    background-color: var(--tertiary);
}

.notification-error {
    background-color: var(--danger);
}

.notification-warning {
    background-color: var(--warning);
}

.notification-info {
    background-color: var(--secondary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Results Page Specific */
.results-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1100px) {
    .results-layout {
        grid-template-columns: 1fr;
    }
}

.summary-panel .action-section {
    justify-content: flex-start;
}

.project-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray);
    margin-left: auto;
}

.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.large-stat {
    border-left: 5px solid var(--secondary);
    background: rgba(0, 153, 229, 0.1);
    padding: 25px;
}

.large-stat .stat-icon {
    color: var(--secondary);
}

.large-stat .stat-value {
    font-size: 2rem;
}

.info-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px;
    background: var(--light);
    border-radius: var(--border-radius);
}

.dark-mode .info-grid {
    background: #333;
}

.grid-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    padding: 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
}

.grid-item i {
    color: var(--primary);
}

.grid-item strong {
    margin-left: auto;
    font-weight: 700;
    color: var(--primary);
}

/* BOQ Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95rem;
}

.data-table th, .data-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-light);
}

.data-table th {
    background-color: var(--primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 76, 76, 0.05);
}

.total-row td {
    font-weight: 600;
    background-color: rgba(0, 153, 229, 0.1);
}

.grand-total-row td {
    font-weight: 700;
    background-color: var(--tertiary);
    color: var(--dark);
    font-size: 1.1rem;
}

.cost-panel .panel-header {
    display: flex;
    align-items: center;
}

.currency-selector-wrapper {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.currency-selector-wrapper select {
    width: auto;
    padding: 8px 12px;
}

.exchange-rate {
    text-align: center;
    margin: 15px 0 25px;
    font-weight: 600;
    color: var(--primary);
    padding: 10px;
    border: 1px dashed var(--primary);
    border-radius: 5px;
    background: rgba(255, 76, 76, 0.05);
}

.cost-note {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 10px;
    text-align: right;
    width: 100%;
}

/* Quotation Page Specific */
.quotation-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1200px) {
    .quotation-wrapper {
        grid-template-columns: 1fr;
    }
}

.quotation-preview-panel {
    border: 2px solid var(--primary);
    padding: 30px;
    position: relative;
    background: white;
}

.dark-mode .quotation-preview-panel {
    background: #2d2d2d;
}

.quote-number {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.sender-info, .client-info {
    margin-bottom: 25px;
    line-height: 1.8;
    padding: 15px;
    border-radius: 5px;
    background: rgba(0, 153, 229, 0.05);
}

.sender-info {
    font-size: 0.9rem;
    color: var(--gray);
}

.client-info {
    border-left: 3px solid var(--secondary);
    padding-left: 20px;
    font-size: 1rem;
    font-weight: 500;
}

.quotation-section-title {
    color: var(--primary);
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 10px;
    font-size: 1.3rem;
}

.scope-of-work {
    font-style: italic;
    color: var(--gray);
    padding: 15px;
    background: rgba(255, 76, 76, 0.05);
    border-radius: 5px;
    line-height: 1.6;
}

.terms-list {
    list-style: none;
    padding: 0;
    margin-top: 20px;
}

.terms-list li {
    margin-bottom: 12px;
    color: var(--dark);
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
}

.terms-list li i {
    color: var(--tertiary);
    margin-top: 3px;
}

.signature-line {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 2px solid var(--gray-light);
    text-align: right;
    font-style: italic;
    font-weight: 600;
    color: var(--dark);
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .main-header,
    .main-nav,
    .action-section,
    .footer-details,
    .footer-bottom,
    .disclaimer-section {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .panel {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    .quotation-preview-panel {
        border: 1px solid #000 !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .logo {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .main-nav a {
        width: 100%;
        justify-content: center;
    }

    .form-row, .form-row.three-col {
        flex-direction: column;
        gap: 15px;
    }

    .calculator-wrapper {
        gap: 20px;
    }

    .panel {
        padding: 20px;
    }

    .preview-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }

    .action-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }

    .footer-details {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .footer-links {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }

    .contact-info {
        text-align: center;
    }

    .other-tools-list {
        grid-template-columns: 1fr;
    }

    .visitor-counter {
        margin: 10px 0;
        width: 100%;
        justify-content: center;
    }

    .tools-category h4 {
        font-size: 1.1rem;
    }

    .affiliate-area {
        flex-direction: column;
    }

    .affiliate-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }

    .quotation-preview-panel {
        padding: 20px;
    }

    .results-layout {
        gap: 20px;
    }
}

/* Tablet optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .results-layout {
        grid-template-columns: 1fr;
    }

    .quotation-wrapper {
        grid-template-columns: 1fr;
    }
    
    .other-tools-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Styles for Accessibility */
:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Skip to main content link for screen readers */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px;
    z-index: 100;
    text-decoration: none;
}

.skip-to-content:focus {
    top: 0;
}

/* Loading animation for better UX */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
