/* Soundproof Calculator - Main Stylesheet */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* Header and Navigation */
header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 1.5rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0 1rem;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav a:hover,
nav a.active {
    background-color: #34495e;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main Content */
main {
    background-color: white;
    padding: 2rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.3);
}

.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-item,
.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

input[type="checkbox"],
input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.form-section {
    border: 1px solid #ecf0f1;
    padding: 1.5rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    background-color: #fafafa;
}

.form-section h3 {
    margin-top: 0;
}

/* Grid Layout for Form Fields */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Buttons */
button {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

button:hover {
    background-color: #2980b9;
}

button.secondary {
    background-color: #95a5a6;
}

button.secondary:hover {
    background-color: #7f8c8d;
}

/* Results Section */
.results-section {
    display: none;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #ecf0f1;
}

.results-section.show {
    display: block;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    background-color: white;
}

.results-table th,
.results-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ecf0f1;
}

.results-table th {
    background-color: #2c3e50;
    color: white;
    font-weight: 600;
}

.results-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.results-table tr:hover {
    background-color: #f0f0f0;
}

.results-summary {
    background-color: #e8f4f8;
    padding: 1.5rem;
    border-left: 4px solid #3498db;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 1.1rem;
}

.summary-row.total {
    font-weight: bold;
    font-size: 1.25rem;
    border-top: 2px solid #3498db;
    padding-top: 1rem;
    margin-top: 1rem;
}

.effectiveness {
    background-color: #d5f4e6;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    color: #27ae60;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 400px;
    margin-bottom: 2rem;
    background-color: #f9f9f9;
    padding: 1rem;
    border-radius: 4px;
}

canvas {
    max-height: 400px;
}

/* Images */
.material-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.image-card {
    text-align: center;
    border: 1px solid #ecf0f1;
    padding: 1rem;
    border-radius: 4px;
    background-color: #fafafa;
}

.image-card img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.image-card svg {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.image-card p {
    font-size: 0.9rem;
    color: #666;
}

/* Affiliate Links */
.affiliate-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.affiliate-link {
    display: inline-block;
    background-color: #f39c12;
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    text-align: center;
}

.affiliate-link:hover {
    background-color: #e67e22;
}

/* AdSense Placeholder */
.adsense-placeholder {
    background-color: #ecf0f1;
    border: 2px dashed #95a5a6;
    padding: 2rem;
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 2rem;
    border-radius: 4px;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Articles/Tips Pages */
.article-content {
    line-height: 1.8;
}

.article-content ul,
.article-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

/* Material Cards */
.material-card {
    border: 1px solid #ecf0f1;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    background-color: #fafafa;
}

.material-card h3 {
    color: #2c3e50;
}

.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.pros,
.cons {
    padding: 1rem;
    border-radius: 4px;
}

.pros {
    background-color: #d5f4e6;
    border-left: 4px solid #27ae60;
}

.cons {
    background-color: #fadbd8;
    border-left: 4px solid #e74c3c;
}

.pros h4,
.cons h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.pros ul,
.cons ul {
    margin-left: 1.5rem;
    list-style-type: none;
}

.pros li:before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
    margin-right: 0.5rem;
}

.cons li:before {
    content: "✗ ";
    color: #e74c3c;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* FAQ Page */
.faq-item {
    border-left: 4px solid #3498db;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.faq-item h3 {
    margin-top: 0;
    cursor: pointer;
    color: #2c3e50;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-item h3:hover {
    color: #3498db;
}

.faq-toggle {
    font-size: 1.25rem;
    user-select: none;
}

.faq-answer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ecf0f1;
    display: none;
}

.faq-answer.show {
    display: block;
}

/* Gallery Page */
.gallery-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.gallery-card {
    border: 1px solid #ecf0f1;
    border-radius: 8px;
    overflow: hidden;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.gallery-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-image {
    width: 100%;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-image svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-content {
    padding: 1.5rem;
}

.gallery-content h3 {
    margin-top: 0;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.gallery-content .price {
    font-size: 1.25rem;
    font-weight: bold;
    color: #27ae60;
    margin: 0.5rem 0;
}

.gallery-content .specs {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.gallery-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.gallery-content li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.gallery-link {
    display: inline-block;
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.3s;
}

.gallery-link:hover {
    border-bottom-color: #3498db;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.25rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    nav a {
        padding: 0.75rem;
    }

    main {
        padding: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .pros-cons {
        grid-template-columns: 1fr;
    }

    .material-images {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-image {
        height: 250px;
    }

    .gallery-content {
        padding: 1rem;
    }

    .form-section {
        padding: 1rem;
    }

    .results-table {
        font-size: 0.9rem;
    }

    .results-table th,
    .results-table td {
        padding: 0.75rem 0.5rem;
    }

    .summary-row {
        font-size: 1rem;
    }
}

/* Print Styles */
@media print {
    header,
    footer,
    nav,
    button {
        display: none;
    }

    main {
        box-shadow: none;
        padding: 0;
    }

    .results-section {
        display: block !important;
    }

    body {
        background-color: white;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #95a5a6;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}
