/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.6;
    font-size: 16px;
}

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

/* Compact Header */
.compact-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.75rem 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1e40af;
    font-weight: 600;
}

.logo-small {
    height: 32px;
    width: auto;
    max-width: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.brand-text {
    font-size: 1.125rem;
    color: #1e40af;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
}

.nav-item {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-item:hover,
.nav-item.active {
    color: #1e40af;
    background-color: #f1f5f9;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    width: 22px;
    height: 2px;
    background-color: #3b82f6;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: 1rem 0;
}

.mobile-nav-item {
    display: block;
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
    color: #1e40af;
    background-color: #f1f5f9;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
}

/* Welcome Section */
.welcome-section {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.welcome-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.welcome-content p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Calculator Section */
.calculator-section {
    padding: 3rem 0;
    background: #ffffff;
}

.calculator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 280px;
    gap: 2rem;
    align-items: start;
}

.calculator-panel,
.results-panel {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.panel-header {
    background: #f8fafc;
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.panel-header h2 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.panel-header h2 i {
    color: #3b82f6;
}

/* Calculator Form */
.calculator-form {
    padding: 1.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #374151;
}

.input-field {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix,
.input-suffix {
    position: absolute;
    color: #6b7280;
    font-weight: 600;
    z-index: 2;
}

.input-prefix {
    left: 12px;
}

.input-suffix {
    right: 12px;
}

.input-field input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.input-field input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-prefix + input {
    padding-left: 35px;
}

.input-help {
    display: block;
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Radio Options */
.radio-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.radio-option:hover {
    border-color: #3b82f6;
    background-color: #f8fafc;
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-mark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-mark {
    border-color: #3b82f6;
    background-color: #3b82f6;
}

.radio-option input[type="radio"]:checked + .radio-mark::after {
    content: '';
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.radio-option input[type="radio"]:checked ~ .radio-text {
    color: #1e40af;
    font-weight: 500;
}

.radio-text {
    color: #374151;
    transition: all 0.3s ease;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    flex: 1;
    justify-content: center;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background-color: #f8fafc;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-outline {
    background-color: transparent;
    color: #3b82f6;
    border: 2px solid #3b82f6;
}

.btn-outline:hover {
    background-color: #3b82f6;
    color: white;
}

/* Results Panel */
.results-content {
    padding: 1.5rem;
}

.results-summary {
    margin-bottom: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #f1f5f9;
}

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

.result-item.total {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    border: 2px solid #3b82f6;
}

.result-item .label {
    font-weight: 500;
    color: #374151;
}

.result-item .value {
    font-weight: 600;
    color: #1e293b;
    font-size: 1.125rem;
}

.result-item.total .value {
    color: #3b82f6;
    font-size: 1.25rem;
}

/* Workings Panel */
.workings-panel {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.workings-panel h3 {
    color: #374151;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.workings-content {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-line;
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Sidebar Ads */
.sidebar-ads {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 100px;
}

/* Quick Info Section */
.quick-info-section {
    padding: 3rem 0;
    background: #f8fafc;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-item {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.info-item:hover {
    transform: translateY(-4px);
}

.info-icon {
    margin-bottom: 1rem;
}

.info-icon i {
    font-size: 2.5rem;
    color: #3b82f6;
}

.info-item h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

.info-item p {
    color: #64748b;
}

/* Google AdSense Styles */
.ad-section {
    padding: 2rem 0;
    background-color: #f8fafc;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.ad-section.ad-banner {
    padding: 1.5rem 0;
}

.ad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0 auto;
    position: relative;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.ad-container.ad-leaderboard {
    max-width: 728px;
    min-height: 90px;
    padding: 10px;
}

.ad-container.ad-rectangle {
    max-width: 300px;
    min-height: 250px;
    padding: 10px;
    margin-bottom: 1rem;
}

.ad-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Disclaimer Section */
.disclaimer-section {
    padding: 3rem 0;
    background-color: #fef3f2;
}

.disclaimer-box {
    background: white;
    border-radius: 12px;
    border: 1px solid #fecaca;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.disclaimer-header {
    background: #fef2f2;
    padding: 1.5rem;
    border-bottom: 1px solid #fecaca;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.disclaimer-header i {
    color: #f59e0b;
    font-size: 1.5rem;
}

.disclaimer-header h3 {
    color: #dc2626;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.disclaimer-content {
    padding: 1.5rem;
}

.disclaimer-content p {
    margin-bottom: 1rem;
    color: #374151;
}

.disclaimer-content ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.disclaimer-content li {
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.disclaimer-footer {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.875rem;
}

.disclaimer-footer a {
    color: #3b82f6;
    text-decoration: none;
}

.disclaimer-footer a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: #1e293b;
    color: #e2e8f0;
    text-align: center;
    padding: 2rem 0;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer small {
    opacity: 0.8;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close:hover {
    background: #f1f5f9;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.preview-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.preview-section h4 {
    color: #374151;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

#emailPreview {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #4b5563;
    white-space: pre-line;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .mobile-menu.show {
        display: block;
    }
    
    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }

    .logo-small {
        height: 28px;
        max-width: 28px;
    }

    .brand-text {
        font-size: 1rem;
    }

    .welcome-content h1 {
        font-size: 2rem;
    }

    .welcome-content p {
        font-size: 1rem;
    }

    .calculator-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .sidebar-ads {
        position: static;
        margin-top: 2rem;
    }

    .ad-container.ad-leaderboard {
        max-width: 320px;
        transform: scale(0.9);
    }

    .ad-container.ad-rectangle {
        max-width: 280px;
        transform: scale(0.9);
    }

    .form-actions {
        flex-direction: column;
    }

    .results-actions {
        flex-direction: column;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .disclaimer-footer {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .calculator-form,
    .results-content {
        padding: 1rem;
    }

    .welcome-section {
        padding: 2rem 0;
    }

    .calculator-section,
    .quick-info-section {
        padding: 2rem 0;
    }
}

/* Contact Section */
.contact-section {
    padding: 4rem 0;
    background: linear-gradient(to bottom, #ffffff 0%, #f8fafc 100%);
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 3rem;
    align-items: start;
}

.contact-info h2 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.contact-info h2 i {
    color: #3b82f6;
}

.contact-info > p {
    color: #64748b;
    font-size: 1.125rem;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.contact-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: start;
    gap: 1rem;
}

.feature-item i {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-top: 0.25rem;
}

.feature-item h4 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-item p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.contact-form-container {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.contact-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.contact-form .input-group {
    margin-bottom: 0;
}

.contact-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: #334155;
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.contact-form select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.contact-form textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    color: #334155;
    resize: vertical;
    min-height: 120px;
    transition: all 0.3s ease;
}

.contact-form textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    width: 100%;
    justify-content: center;
}

/* Success/Error Messages */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert i {
    font-size: 1.25rem;
}

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

/* Responsive Contact Section */
@media (max-width: 968px) {
    .contact-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .contact-form .form-row {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .contact-form-container {
        padding: 2rem;
    }
}