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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography with Responsive Font Sizes */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: clamp(2rem, 5vw, 2.5rem);
    margin-bottom: 10px;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 20px;
}

h3 {
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin-bottom: 15px;
}

h4 {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    margin-bottom: 10px;
}

h5 {
    font-size: clamp(1rem, 2vw, 1.1rem);
    margin-bottom: 8px;
}

h6 {
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    margin-bottom: 5px;
}

/* Improved paragraph spacing */
p {
    margin-bottom: 1.2rem;
}

p + p {
    margin-top: 1.5rem;
}

/* Accessibility */
button:focus,
input:focus,
select:focus {
    outline: 3px solid #333;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #212529;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
}

.skip-link:focus {
    top: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

/* Header - No box, just text */
.header {
    text-align: center;
    color: #333;
    padding: 20px;
}

.header h1 {
    color: #333;
}

.header p {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #333;
}

/* Navigation Tabs - Always visible */
.calculator-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.tab-btn {
    padding: 12px 20px;
    background: rgba(255,255,255,0.8);
    color: #333;
    border: 2px solid #dee2e6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-weight: 500;
    font-size: 14px;
}

.tab-btn:hover, 
.tab-btn.active {
    background: #333;
    color: white;
    transform: translateY(-2px);
    border-color: transparent;
}

/* Calculator Container */
.calculator-container {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 30px;
    backdrop-filter: blur(10px);
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.calculator-section {
    display: none;
}

.calculator-section.active {
    display: block;
}

/* Business Explanation Sections */
.business-explanation {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 30px;
    overflow: hidden;
}

.explanation-header {
    color: #333;
    padding: 20px 25px;
    margin: 0;
}

.explanation-header h3 {
    margin: 0;
    font-weight: 600;
}

.explanation-content {
    padding: 25px;
}

.explanation-content p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.explanation-content strong {
    color: #212529;
    font-weight: 600;
}

/* Risk List Styling */
.risk-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.risk-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(255,255,255,0.9);
    border-radius: 8px;
    border-left: 4px solid #dc3545;
    transition: all 0.3s ease;
}

.risk-list li:hover {
    background: rgba(255,255,255,1);
    transform: translateX(5px);
}

.risk-icon {
    font-size: 1rem;
    margin-right: 12px;
    flex-shrink: 0;
    margin-top: 2px;
    color: #dc3545;
    font-weight: bold;
}

.risk-list li strong {
    color: #c82333;
    margin-right: 8px;
}

/* Value Proposition Styling */
.value-proposition {
    background: #28a745;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    margin-bottom: 30px;
    font-weight: 500;
}

.value-proposition strong {
    color: #ffffff;
    font-weight: 600;
}

/* Form Inputs */
.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.input-group input, 
.input-group select {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #ffffff;
    color: #333;
}

.input-group input:focus, 
.input-group select:focus {
    outline: none;
    border-color: #333;
}

.input-group small {
    margin-top: 5px;
    font-size: 0.85rem;
    color: #333;
}

.currency-input {
    position: relative;
}

/* Results container */
.results-container {
    background: #fff3cd;
    color: #333;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
}

.results-container h3 {
    color: #333;
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-item {
    text-align: center;
    padding: 20px 15px;
    background: #ffc107ba;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.result-item:hover {
    background: #ffc1077e;
    transform: translateY(-2px);
}

.result-value {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.2;
}

.result-label {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
    opacity: 0.95;
}

/* Error Message Styling */
.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}

.error-message p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
}

.error-message strong {
    color: #721c24;
    font-weight: 600;
}

/* Subscription Tips Styling */
.subscription-tips {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}

.subscription-tips h4 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.tip-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.tip-section h5 {
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
}

.tip-section p {
    margin-bottom: 10px;
    color: #333;
    font-size: 0.95rem;
}

.tip-section ul {
    margin-left: 20px;
    color: #333;
}

.tip-section ul li {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Tables */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

.comparison-table th {
    background: #333;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.comparison-table td {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    color: #333;
}

.comparison-table tr:nth-child(even) {
    background: #f8f9fa;
}

.comparison-table tr:nth-child(even) td {
    color: #333;
}

/* Sections */
.educational-section,
.tips-section {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
    border: 1px solid #dee2e6;
}

.educational-section h2,
.tips-section h2 {
    color: #333;
    margin-bottom: 20px;
}

.educational-section p,
.tips-section p {
    color: #333;
    line-height: 1.6;
    margin-bottom: 1.2rem;
}

/* Strategy Guide Box */
.strategy-guide {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

/* FAQ */
.faq-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.faq-item:hover {
    background: #e9ecef;
}

.faq-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.faq-answer {
    color: #333;
    display: none;
}

.faq-item.active .faq-answer {
    display: block;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.tip-card {
    padding: 20px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
    border-radius: 12px;
}

.tip-card h4 {
    margin-bottom: 10px;
    color: #333;
}

/* Advertisement Containers */
.adsense-container {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    text-align: center;
}

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

.adsense-responsive-ad {
    margin-bottom: 20px;
}

.responsive-ad {
    min-height: 250px;
    width: 100%;
    max-width: 970px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.ad-placeholder {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    height: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.ad-placeholder:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.ad-placeholder-content {
    text-align: center;
    padding: 20px;
}

.ad-placeholder-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.ad-placeholder-content p {
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.ad-cta {
    display: inline-block;
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.ad-cta:hover {
    background: #5a6268;
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .header {
        padding-top: 20px;
        padding-bottom: 0;
    }
    
    .input-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-tabs {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 20px 15px;
    }
    
    .tab-btn {
        width: 100%;
        max-width: 300px;
        padding: 16px 20px;
        font-size: 16px;
        text-align: center;
    }
    
    .container {
        padding: 15px;
    }
    
    .calculator-container {
        padding: 20px;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .adsense-container {
        padding: 15px;
        margin: 20px 0;
    }
    
    .responsive-ad {
        min-height: 200px;
    }
    
    .explanation-header {
        padding: 15px 20px;
    }
    
    .explanation-content {
        padding: 20px;
    }
    
    .risk-list li {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .risk-icon {
        font-size: 0.9rem;
        margin-right: 10px;
    }
    
    .value-proposition {
        padding: 15px;
        margin-top: 15px;
    }
    
    .subscription-tips {
        padding: 15px;
    }
    
    .tip-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .tip-section ul {
        margin-left: 15px;
    }
    
    .error-message {
        padding: 15px;
        margin-top: 15px;
    }
}

@media (max-width: 480px) {
    .tab-btn {
        padding: 14px 18px;
        font-size: 15px;
        max-width: 280px;
    }
    
    .calculator-container {
        padding: 15px;
    }
    
    .input-group input,
    .input-group select {
        padding: 10px;
        font-size: 14px;
    }
    
    .results-container {
        padding: 20px;
    }
    
    .result-value {
        font-size: 1.3rem;
    }
    
    .tip-card {
        padding: 15px;
    }
    
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 10px;
    }
    
    .explanation-header {
        padding: 12px 15px;
    }
    
    .explanation-content {
        padding: 15px;
    }
    
    .explanation-content p {
        font-size: 0.9rem;
    }
    
    .risk-list li {
        padding: 8px;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .risk-icon {
        margin-bottom: 5px;
        margin-right: 0;
        font-size: 0.8rem;
    }
    
    .value-proposition {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .ad-placeholder {
        min-height: 150px;
    }
    
    .ad-placeholder-content h3 {
        margin-bottom: 10px;
    }
    
    .ad-placeholder-content p {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
    
    .ad-cta {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .subscription-tips {
        padding: 12px;
    }
    
    .tip-section {
        padding: 10px;
    }
    
    .tip-section h5 {
        font-size: 1rem;
    }
    
    .tip-section p {
        font-size: 0.9rem;
    }
    
    .tip-section ul {
        margin-left: 12px;
    }
    
    .tip-section ul li {
        font-size: 0.85rem;
    }
    
    .error-message {
        padding: 12px;
        font-size: 0.9rem;
    }
}

/* Tablet specific adjustments */
@media (min-width: 481px) and (max-width: 768px) {
    .calculator-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 15px;
    }
    
    .tab-btn {
        width: auto;
        max-width: none;
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .tab-btn {
        border: 2px solid #333;
    }
    
    .tab-btn.active {
        border-color: #212529;
        background: #333;
    }
    
    .input-group input,
    .input-group select {
        border-width: 3px;
    }
    
    .result-item {
        border: 2px solid rgba(255,255,255,0.5);
    }
    
    .tip-card {
        border: 2px solid #333;
    }
    
    .error-message {
        border: 2px solid #f5c6cb;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tab-btn:hover,
    .tab-btn.active {
        transform: none;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .header {
        color: black;
        background: none;
    }
    
    .calculator-tabs,
    .adsense-container {
        display: none;
    }
    
    .calculator-container,
    .educational-section,
    .tips-section {
        background: white;
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .results-container {
        background: #f0f0f0;
        color: black;
    }
    
    .tip-card {
        background: #f0f0f0;
        color: black;
    }
    
    .comparison-table {
        border: 1px solid #000;
    }
    
    .comparison-table th {
        background: #e0e0e0;
        color: black;
    }
    
    .business-explanation {
        background: #f8f9fa;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .explanation-header {
        background: #ddd;
        color: black;
    }
    
    .risk-list li {
        background: #f0f0f0;
        border-left-color: #999;
    }
    
    .risk-icon {
        color: #666;
    }
    
    .value-proposition {
        background: #e0e0e0;
        color: #333;
    }
    
    .subscription-tips {
        background: #f0f0f0;
        color: black;
    }
    
    .tip-section {
        background: #f5f5f5;
        border-left-color: #999;
    }
    
    .error-message {
        background: #f0f0f0;
        color: black;
        border: 1px solid #ccc;
    }
}

/* Focus Visible Support */
.tab-btn:focus-visible,
.input-group input:focus-visible,
.input-group select:focus-visible,
.faq-item:focus-visible,
.ad-cta:focus-visible {
    outline: 3px solid #333;
    outline-offset: 2px;
}

/* Loading States */
.calculator-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

.result-item.loading .result-value {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Animation for explanation sections */
.business-explanation {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.5);
}

/* Additional styles for the updated product pricing calculator results */

/* Enhanced results grid for 6 items */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* Responsive adjustments for 6-item grid */
@media (min-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* Enhanced result item styling for better percentage display */
.result-item .result-value {
    font-size: clamp(1.3rem, 3vw, 2rem);
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    line-height: 1.2;
    word-break: break-word;
}

/* Specific styling for percentage values */
.result-item:has(.result-label:contains("(%)")) .result-value {
    color: #28a745;
    font-weight: 700;
}

/* Enhanced mobile responsiveness for 6-item layout */
@media (max-width: 480px) {
    .results-grid {
        gap: 15px;
    }
    
    .result-item {
        padding: 15px 10px;
        min-height: 120px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .result-item .result-value {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }
    
    .result-item .result-label {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

/* Improved explanation section for longer content */
#be-breakeven-explanation {
    margin-top: 15px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 5px;
    line-height: 1.6;
}

#be-breakeven-explanation strong {
    color: #333;
    font-weight: 600;
}

/* Enhanced print styles for new layout */
@media print {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        page-break-inside: avoid;
    }
    
    .result-item {
        background: #f0f0f0;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .result-item .result-value {
        color: #000;
        font-size: 1.3rem;
    }
    
    .result-item .result-label {
        color: #333;
        font-size: 0.9rem;
    }
    
    #be-breakeven-explanation {
        background: #f5f5f5;
        border: 1px solid #ccc;
        color: #000;
        page-break-inside: avoid;
    }
}

/* Enhanced styles for the rebuilt subscription calculator */

.result-item.highlight-result {
    background: #fff3cd; /* Same as other result items */
    color: #333; /* Same as other result items */
    border: 1px solid rgba(255,255,255,0.2); /* Same as other result items */
    transform: none; /* Remove scaling */
    box-shadow: none; /* Remove special shadow */
}

.result-item.highlight-result .result-value {
    color: #333; /* Same as other result items */
    font-size: 2rem; /* Same as other result items */
    text-shadow: none; /* Remove text shadow */
}

.result-item.highlight-result .result-label {
    color: #333; /* Same as other result items */
    font-weight: 500; /* Same as other result items */
    text-shadow: none; /* Remove text shadow */
    opacity: 0.95; /* Same as other result items */
}

.result-item.highlight-result:hover {
    background: #ffc1077e; /* Same hover as other result items */
    transform: translateY(-2px); /* Same hover as other result items */
}

/* Subscription analysis section */
.subscription-analysis {
    margin-top: 25px;
    padding: 25px;
    background: rgba(255,255,255,0.4);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
}

.subscription-analysis h4 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 1.3rem;
}

.analysis-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    border-left: 4px solid #333;
}

.analysis-section h5 {
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

.analysis-section p {
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

.analysis-section ul {
    margin: 10px 0 10px 20px;
    color: #333;
}

.analysis-section ul li {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.analysis-section strong {
    color: #212529;
    font-weight: 600;
}

/* Color coding for metrics analysis */
.analysis-section span[style*="color: #28a745"] {
    font-weight: 600;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.analysis-section span[style*="color: #ffc107"] {
    font-weight: 600;
    background: rgba(255, 193, 7, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.analysis-section span[style*="color: #dc3545"] {
    font-weight: 600;
    background: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Enhanced results grid for multiple sections */
.results-container h4 {
    color: #333;
    font-weight: 600;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 8px;
    margin-bottom: 15px;
    margin-top: 30px;
}

/* Responsive adjustments for more complex layout */
@media (max-width: 768px) {
    .result-item.highlight-result {
        transform: none;
    }
    
    .result-item.highlight-result:hover {
        transform: translateY(-2px);
    }
    
    .result-item.highlight-result .result-value {
        font-size: 1.5rem;
    }
    
    .subscription-analysis {
        padding: 20px;
        margin-top: 20px;
    }
    
    .analysis-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .analysis-section h5 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .analysis-section p {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .analysis-section ul li {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .result-item.highlight-result .result-value {
        font-size: 1.3rem;
    }
    
    .subscription-analysis {
        padding: 15px;
    }
    
    .subscription-analysis h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .analysis-section {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .analysis-section h5 {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .analysis-section p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .analysis-section ul {
        margin-left: 15px;
    }
    
    .analysis-section ul li {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

/* Print styles for subscription calculator */
@media print {
    .result-item.highlight-result {
        background: #f0f0f0 !important;
        color: #000 !important;
        border: 1px solid #ccc;
        transform: none;
        box-shadow: none;
    }
    
    .result-item.highlight-result .result-value {
        color: #000 !important;
        text-shadow: none;
        font-size: 1.5rem;
    }
    
    .result-item.highlight-result .result-label {
        color: #333 !important;
        text-shadow: none;
        font-weight: bold;
    }
    
    .result-item.negative-profit {
        background: #f0f0f0 !important;
        border: 2px solid #000 !important;
    }
    
    .result-item.negative-profit .result-value,
    .result-item.negative-profit .result-label {
        color: #000 !important;
        font-weight: bold;
    }
    
    .subscription-analysis {
        background: #f8f9fa !important;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .analysis-section {
        background: #fff !important;
        border-left: 3px solid #333;
        page-break-inside: avoid;
        margin-bottom: 15px;
    }
    
    .analysis-section h5 {
        color: #000 !important;
    }
    
    .analysis-section p,
    .analysis-section ul li {
        color: #333 !important;
    }
    
    .analysis-section span {
        background: none !important;
        padding: 0 !important;
        font-weight: bold !important;
    }
}

/* Loading states for subscription calculator */
.subscription-analysis.loading {
    opacity: 0.6;
    pointer-events: none;
}

.subscription-analysis.loading .analysis-section {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Remove any special focus states for highlight result */
.result-item.highlight-result:focus-visible {
    outline: 3px solid #333;
    outline-offset: 2px;
}

/* Animation for highlight result */
.result-item.highlight-result {
    animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
    0%, 100% { 
        box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
    }
    50% { 
        box-shadow: 0 12px 35px rgba(40, 167, 69, 0.5);
    }
}

/* Smooth transitions for all elements */
.analysis-section {
    transition: all 0.3s ease;
}

.analysis-section:hover {
    background: rgba(255,255,255,0.8);
    transform: translateX(3px);
}

/* Improved typography for better readability */
.subscription-analysis {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
}

.analysis-section strong {
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Remove highlight animation for regular contribution margin */
.result-item.highlight-result {
    animation: none;
}

.result-item.highlight-result::before {
    display: none;
}

/* 2. Add red styling for negative profit values */
.result-item.negative-profit {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
}

.result-item.negative-profit .result-value {
    color: #721c24 !important;
    font-weight: bold;
}

.result-item.negative-profit .result-label {
    color: #721c24 !important;
}

.result-item.negative-profit:hover {
    background: #f1aeb5 !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .result-item.highlight-result {
        border: 2px solid #333;
        background: #fff !important;
    }
    
    .result-item.negative-profit {
        border: 3px solid #000 !important;
        background: #fff !important;
    }
    
    .analysis-section {
        border-left: 5px solid #000;
        border: 2px solid #333;
    }
    
    .analysis-section span {
        border: 1px solid #333 !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .result-item.highlight-result {
        animation: none;
        transform: none;
    }
    
    .result-item.highlight-result:hover {
        transform: none;
    }
    
    .analysis-section:hover {
        transform: none;
    }
}

/* Print Button Styling */
.print-button-container {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.3);
}

.print-btn {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.print-btn:hover {
    background: linear-gradient(135deg, #555 0%, #777 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.print-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.print-btn:focus {
    outline: 3px solid #333;
    outline-offset: 2px;
}

.print-icon {
    font-size: 1.1rem;
    margin-right: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .print-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .print-button-container {
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    .print-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
        width: 100%;
        max-width: 280px;
    }
    
    .print-icon {
        font-size: 1rem;
    }
}

/* Print-specific styles - hide print button when printing */
@media print {
    .print-button-container {
        display: none !important;
    }
    
    .print-btn {
        display: none !important;
    }
    
    /* Ensure calculator sections are visible when printing */
    .calculator-section {
        display: block !important;
    }
    
    /* Hide non-essential elements when printing */
    .calculator-tabs,
    .adsense-container,
    .header p {
        display: none !important;
    }
    
    /* Print-friendly styling */
    .results-container {
        page-break-inside: avoid;
        margin-bottom: 30px;
    }
    
    .results-grid {
        page-break-inside: avoid;
    }
    
    .analysis-section,
    .subscription-analysis {
        page-break-inside: avoid;
    }
    
    /* Ensure good contrast for printing */
    .result-item {
        border: 1px solid #000 !important;
        background: #f0f0f0 !important;
    }
    
    .result-value {
        color: #000 !important;
        font-weight: bold;
    }
    
    .result-label {
        color: #333 !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .print-btn {
        border: 2px solid #000;
        background: #000;
        color: #fff;
    }
    
    .print-btn:hover {
        background: #333;
        border-color: #333;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .print-btn {
        transition: none;
    }
    
    .print-btn:hover {
        transform: none;
    }
}

/* Service Analysis Section Styling */
.service-analysis {
    margin-top: 25px;
    padding: 0 25px 25px;
    background: rgba(255,255,255,0.4);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
}

.service-analysis h4 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    font-size: 1.3rem;
}

/* Consistent analysis section styling across all calculators */
.service-analysis .analysis-section,
.subscription-analysis .analysis-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255,255,255,0.6);
    border-radius: 8px;
    border-left: 4px solid #333;
}

.service-analysis .analysis-section h5,
.subscription-analysis .analysis-section h5 {
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 1.1rem;
}

.service-analysis .analysis-section p,
.subscription-analysis .analysis-section p {
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

.service-analysis .analysis-section ul,
.subscription-analysis .analysis-section ul {
    margin: 10px 0 10px 20px;
    color: #333;
}

.service-analysis .analysis-section ul li,
.subscription-analysis .analysis-section ul li {
    margin-bottom: 6px;
    line-height: 1.4;
    font-size: 0.9rem;
}

.service-analysis .analysis-section strong,
.subscription-analysis .analysis-section strong {
    color: #212529;
    font-weight: 600;
}

/* Color coding for analysis insights */
.service-analysis .analysis-section span[style*="color: #28a745"],
.subscription-analysis .analysis-section span[style*="color: #28a745"] {
    font-weight: 600;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.service-analysis .analysis-section span[style*="color: #ffc107"],
.subscription-analysis .analysis-section span[style*="color: #ffc107"] {
    font-weight: 600;
    background: rgba(255, 193, 7, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.service-analysis .analysis-section span[style*="color: #dc3545"],
.subscription-analysis .analysis-section span[style*="color: #dc3545"] {
    font-weight: 600;
    background: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .service-analysis {
        padding: 20px;
        margin-top: 20px;
    }
    
    .service-analysis .analysis-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .service-analysis .analysis-section h5 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .service-analysis .analysis-section p {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .service-analysis .analysis-section ul li {
        font-size: 0.85rem;
        margin-bottom: 4px;
    }
}

@media (max-width: 480px) {
    .service-analysis {
        padding: 15px;
    }
    
    .service-analysis h4 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .service-analysis .analysis-section {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .service-analysis .analysis-section h5 {
        font-size: 0.95rem;
        margin-bottom: 6px;
    }
    
    .service-analysis .analysis-section p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .service-analysis .analysis-section ul {
        margin-left: 15px;
    }
    
    .service-analysis .analysis-section ul li {
        font-size: 0.8rem;
        line-height: 1.3;
    }
}

/* Print styles for service analysis */
@media print {
    .service-analysis {
        background: #f8f9fa !important;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
    
    .service-analysis .analysis-section {
        background: #fff !important;
        border-left: 3px solid #333;
        page-break-inside: avoid;
        margin-bottom: 15px;
    }
    
    .service-analysis .analysis-section h5 {
        color: #000 !important;
    }
    
    .service-analysis .analysis-section p,
    .service-analysis .analysis-section ul li {
        color: #333 !important;
    }
    
    .service-analysis .analysis-section span {
        background: none !important;
        padding: 0 !important;
        font-weight: bold !important;
    }
}

/* Add these CSS styles to your styles.css file */

/* Language Selector Container */
.language-selector-container {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background: rgba(255,255,255,0.95);
    border-bottom: 1px solid #e9ecef;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.9);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.language-selector:hover {
    background: rgba(255,255,255,1);
    border-color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.language-selector label {
    font-size: 0.9rem;
    font-weight: 500;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.language-select-dropdown {
    background: transparent;
    border: none;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    outline: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    min-width: 80px;
}

.language-select-dropdown:hover {
    background: rgba(0,0,0,0.05);
}

.language-select-dropdown:focus {
    background: rgba(0,0,0,0.05);
    outline: 2px solid #333;
    outline-offset: 1px;
}

.language-select-dropdown option {
    background: white;
    color: #333;
    padding: 8px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .language-selector-container {
        justify-content: center;
        padding: 15px;
    }
    
    .language-selector {
        padding: 10px 15px;
        border-radius: 10px;
    }
    
    .language-selector label {
        font-size: 1rem;
    }
    
    .language-select-dropdown {
        font-size: 1rem;
        min-width: 90px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .language-selector-container {
        padding: 10px;
    }
    
    .language-selector {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        padding: 12px;
        text-align: center;
    }
    
    .language-selector label {
        font-size: 0.85rem;
    }
    
    .language-select-dropdown {
        width: 100%;
        max-width: 120px;
        text-align: center;
    }
}

/* Alternative compact language selector (flag-style) */
.language-selector.compact {
    background: transparent;
    border: none;
    padding: 4px 8px;
    position: relative;
}

.language-selector.compact::before {
    content: "🌐";
    font-size: 1.2rem;
    margin-right: 5px;
}

.language-selector.compact label {
    display: none;
}

.language-selector.compact .language-select-dropdown {
    appearance: none;
    background: transparent;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.85rem;
}

/* Language-specific font adjustments */
html[lang="zh"] {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
}

html[lang="hi"] {
    font-family: "Noto Sans Devanagari", "Mangal", "Devanagari Sangam MN", -apple-system, BlinkMacSystemFont, sans-serif;
}

html[lang="es"] {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
}

/* Ensure proper text rendering for different languages */
html[lang="zh"] .result-value,
html[lang="zh"] .result-label,
html[lang="zh"] .input-group label {
    font-weight: 500;
    letter-spacing: 0.5px;
}

html[lang="hi"] .result-value,
html[lang="hi"] .result-label,
html[lang="hi"] .input-group label {
    font-weight: 500;
    line-height: 1.8;
}

/* RTL support (in case you add Arabic or Hebrew later) */
html[dir="rtl"] .language-selector-container {
    justify-content: flex-start;
}

html[dir="rtl"] .language-selector {
    flex-direction: row-reverse;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .language-selector {
        border: 2px solid #000;
        background: white;
    }
    
    .language-selector label {
        color: #000;
        font-weight: bold;
    }
    
    .language-select-dropdown {
        border: 1px solid #000;
        color: #000;
    }
    
    .language-select-dropdown:focus {
        outline: 3px solid #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .language-selector,
    .language-select-dropdown {
        transition: none;
    }
}

/* Print styles - hide language selector when printing */
@media print {
    .language-selector-container {
        display: none !important;
    }
}

/* Focus visible support */
.language-select-dropdown:focus-visible {
    outline: 3px solid #333;
    outline-offset: 2px;
}

/* Animation for language switching */
.language-switching {
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.language-switched {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* Loading state for language switching */
.language-loading {
    pointer-events: none;
    opacity: 0.6;
}

.language-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #333;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Negative profit styling for subscription results */
.result-item.negative-profit {
    background: #f8d7da !important;
    border: 1px solid #f5c6cb !important;
}

.result-item.negative-profit .result-value {
    color: #721c24 !important;
    font-weight: bold;
}

.result-item.negative-profit .result-label {
    color: #721c24 !important;
}

.result-item.negative-profit:hover {
    background: #f1aeb5 !important;
}