/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-color: #374151;
    --text-light: #6b7280;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav a:hover,
.nav a.active {
    opacity: 0.8;
    text-decoration: underline;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.95;
}

/* Main Content */
.main-content {
    padding: 3rem 0;
}

.calculator-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Calculator Panel */
.calculator-panel,
.results-panel {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.calculator-panel h3,
.results-panel h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--light-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.section h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
    text-align: center;
}

.btn-calculate {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 100%;
    margin-bottom: 0.5rem;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.btn-reset {
    background: var(--text-light);
    color: white;
    width: 100%;
}

.btn-reset:hover {
    background: var(--dark-color);
}

.btn-add {
    background: var(--success-color);
    color: white;
    width: 100%;
}

.btn-add:hover {
    background: #059669;
}

/* Wires List */
.wires-list {
    margin-bottom: 1rem;
}

.wire-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.wire-item-info {
    flex: 1;
}

.wire-item-info strong {
    color: var(--primary-color);
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-remove:hover {
    background: #dc2626;
}

/* Results Panel */
.results-content {
    min-height: 400px;
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-light);
    font-size: 1.1rem;
}

.result-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    text-align: center;
}

.fill-percentage {
    font-size: 3rem;
    font-weight: 700;
    margin: 1rem 0;
}

.status-badge {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    margin-top: 1rem;
}

.status-pass {
    background: var(--success-color);
}

.status-fail {
    background: var(--danger-color);
}

.status-warning {
    background: var(--warning-color);
}

.result-details {
    background: var(--light-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: var(--text-light);
}

.result-value {
    font-weight: 600;
    color: var(--dark-color);
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--border-color);
    border-radius: 15px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.progress-fill.warning {
    background: linear-gradient(90deg, var(--warning-color), #dc2626);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #dc2626, #991b1b);
}

.wires-summary {
    margin-top: 1.5rem;
}

.wires-summary h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.wire-summary-item {
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Info Sections */
.info-section,
.guide-section,
.wire-guide-section,
.tips-section,
.related-section,
.keywords-section {
    padding: 3rem 0;
    background: white;
    margin-bottom: 2rem;
}

.info-section:nth-child(even),
.guide-section:nth-child(even) {
    background: var(--light-color);
}

.info-section h2,
.guide-section h2,
.wire-guide-section h2,
.tips-section h2,
.related-section h2,
.keywords-section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--dark-color);
}

.info-grid,
.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.info-card,
.tip-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.info-card h3,
.tip-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card ul,
.tip-card ul {
    list-style-position: inside;
    color: var(--text-color);
}

.info-card li {
    margin-bottom: 0.5rem;
}

/* Conduit Types */
.conduit-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.conduit-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.conduit-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.conduit-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.conduit-card strong {
    color: var(--success-color);
    display: block;
    margin-top: 1rem;
}

/* Wire Types Table */
.wire-types-table {
    overflow-x: auto;
}

.wire-types-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.wire-types-table th,
.wire-types-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.wire-types-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
}

.wire-types-table tr:hover {
    background: var(--light-color);
}

/* Related Cards */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.related-card h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Keywords Section */
.keywords-content {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
}

.keywords-content p {
    margin-bottom: 1rem;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 2rem;
}

.keyword-tags span {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: white;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .calculator-wrapper {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav ul {
        gap: 1rem;
    }

    .hero h2 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .info-grid,
    .tips-grid,
    .conduit-types,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .calculator-panel,
    .results-panel {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }

    .nav ul {
        font-size: 0.9rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .fill-percentage {
        font-size: 2rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .nav,
    .footer,
    .calculator-panel,
    .btn {
        display: none;
    }

    .results-panel {
        box-shadow: none;
    }
}

/* Advanced Section Styling */
.advanced-section {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.advanced-section label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.advanced-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wire-item,
.result-summary,
.result-details {
    animation: fadeIn 0.3s ease;
}

/* Accessibility */
.form-control:focus,
.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "⏳ Calculating...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    font-weight: 600;
}

