/* Tool Hero Section - Required Styles */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* NOR Calculator Section */
.nor-calculator-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 2rem;
}

/* Calculator Card */
.calculator-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.calculator-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.calculator-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    color: #ffffff;
}

.calculator-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.calculator-body {
    padding: 32px;
}

/* Input Groups */
.input-group-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

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

.input-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 4px;
}

.input-select,
.input-text {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #111827;
    transition: all 0.2s ease;
    
}

.input-select:focus,
.input-text:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-select:hover {
    border-color: #d1d5db;
}

.input-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    position: relative;
}

.divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.divider-text {
    background: #ffffff;
    padding: 0 16px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* Results Card */
.results-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.results-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px 24px;
    color: #ffffff;
}

.results-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.results-body {
    padding: 24px;
}

.result-item {
    margin-bottom: 32px;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.result-value {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

/* Truth Table */
.truth-table-wrapper {
    overflow-x: auto;
    margin-top: 12px;
}

.truth-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.truth-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.truth-table th {
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.truth-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s ease;
}

.truth-table tbody tr:last-child {
    border-bottom: none;
}

.truth-table tbody tr:hover {
    background-color: #f9fafb;
}

.truth-table tbody tr.active {
    background-color: #fef3c7;
    font-weight: 600;
}

.truth-table td {
    padding: 12px 16px;
    text-align: center;
    font-size: 16px;
    color: #111827;
}

.truth-table .output-cell {
    font-weight: 600;
    color: #667eea;
}

/* Bitwise Result */
.bitwise-result {
    padding-top: 24px;
    border-top: 2px solid #e5e7eb;
}

.bitwise-output {
    
    font-size: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    line-height: 1.8;
}

.bitwise-output div {
    margin-bottom: 8px;
}

.bitwise-output div:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: #667eea;
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .nor-calculator-section {
        gap: 16px;
    }

    .calculator-body {
        padding: 20px;
    }

    .input-group-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .calculator-title {
        font-size: 20px;
    }

    .results-header {
        padding: 16px 20px;
    }

    .results-body {
        padding: 20px;
    }

    .result-value {
        font-size: 18px;
        padding: 10px 14px;
    }

    .truth-table th,
    .truth-table td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .divider {
        margin: 20px 0;
    }
}

@media (max-width: 480px) {
    .calculator-header,
    .results-header {
        padding: 16px;
    }

    .calculator-body,
    .results-body {
        padding: 16px;
    }

    .input-select,
    .input-text {
        padding: 10px 14px;
        font-size: 14px;
    }

    .truth-table {
        font-size: 12px;
    }

    .truth-table th,
    .truth-table td {
        padding: 8px 10px;
    }
}
