* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 40px;
    text-align: center;
    position: relative;
}

.header-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

header h1 {
    font-size: 2.75em;
    margin-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    opacity: 0.95;
    font-size: 1.15em;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

main {
    padding: 45px;
}

.input-section {
    margin-bottom: 35px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.input-group label {
    font-weight: 600;
    color: #4a5568;
    font-size: 1.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 1.2em;
}

.input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.input-group input[type="text"] {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.2s ease;
    background: #f7fafc;
}

.input-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#validate-btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

#validate-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

#validate-btn:active:not(:disabled) {
    transform: translateY(0);
}

#validate-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    font-size: 1.1em;
}

.advanced-toggle {
    margin-bottom: 20px;
}

.advanced-toggle label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #718096;
    font-size: 0.95em;
    user-select: none;
}

.advanced-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.advanced-options {
    background: #f7fafc;
    padding: 24px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #e2e8f0;
}

.option-group {
    margin-bottom: 0;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 8px;
}

.option-group .unit {
    color: #718096;
    font-size: 0.9em;
}

.option-group input[type="number"] {
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    width: 140px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.option-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.option-hint {
    font-size: 0.9em;
    color: #718096;
    margin-top: 8px;
    line-height: 1.5;
}

.results-section {
    margin-top: 35px;
    padding-top: 35px;
    border-top: 2px solid #e2e8f0;
}

.verdict-section {
    margin-bottom: 35px;
}

.verdict-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 28px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.3em;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.verdict-badge::before {
    font-size: 1.3em;
}

.verdict-badge.likely-valid {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.verdict-badge.likely-valid::before {
    content: "✓";
}

.verdict-badge.uncertain {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.verdict-badge.uncertain::before {
    content: "⚠";
}

.verdict-badge.likely-garbage {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.verdict-badge.likely-garbage::before {
    content: "✗";
}

.confidence-score {
    margin-bottom: 0;
}

.confidence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.confidence-label {
    font-weight: 600;
    font-size: 1.05em;
    color: #4a5568;
}

.confidence-number {
    color: #667eea;
    font-size: 1.5em;
    font-weight: 700;
}

.confidence-bar {
    width: 100%;
    height: 28px;
    background: #e2e8f0;
    border-radius: 14px;
    margin-top: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.confidence-explanation {
    margin-top: 12px;
    font-size: 0.95em;
    color: #718096;
    line-height: 1.5;
}

.checks-list, .signals-section, .timings-section {
    margin-bottom: 32px;
}

.checks-list h3, .signals-section h3, .timings-section h3 {
    margin-bottom: 18px;
    color: #2d3748;
    font-size: 1.4em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 1.1em;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    margin-bottom: 10px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 4px solid #cbd5e0;
    transition: all 0.2s ease;
}

.check-item:hover {
    background: #edf2f7;
    transform: translateX(2px);
}

.check-item.pass {
    border-left-color: #48bb78;
    background: #f0fff4;
}

.check-item.warn {
    border-left-color: #ed8936;
    background: #fffaf0;
}

.check-item.fail {
    border-left-color: #f56565;
    background: #fff5f5;
}

.check-item.skip {
    border-left-color: #a0aec0;
    opacity: 0.75;
}

.check-status {
    font-weight: 700;
    font-size: 0.9em;
    min-width: 70px;
    padding: 4px 10px;
    border-radius: 6px;
    text-align: center;
    flex-shrink: 0;
}

.check-status.pass {
    color: #22543d;
    background: #c6f6d5;
}

.check-status.warn {
    color: #7c2d12;
    background: #fed7aa;
}

.check-status.fail {
    color: #742a2a;
    background: #feb2b2;
}

.check-status.skip {
    color: #4a5568;
    background: #e2e8f0;
}

.check-id {
    font-weight: 600;
    color: #718096;
    font-size: 0.9em;
    flex-shrink: 0;
}

.check-message {
    flex: 1;
    color: #4a5568;
    line-height: 1.5;
}

.signals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.signal-item {
    padding: 16px;
    background: #f7fafc;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.signal-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.signal-label {
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.tooltip-icon {
    font-size: 0.85em;
    opacity: 0.6;
    transition: opacity 0.2s;
    cursor: help;
    color: #667eea;
}

.tooltip-wrapper:hover .tooltip-icon {
    opacity: 1;
}

.tooltip-text {
    display: none;
    background-color: #2d3748;
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 12px 14px;
    position: absolute;
    z-index: 1000;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    max-width: calc(100vw - 40px);
    font-size: 0.9em;
    font-weight: normal;
    line-height: 1.5;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
}

.tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip-text {
    display: block;
}

.signal-value {
    color: #333;
}

.signal-value.true {
    color: #28a745;
}

.signal-value.false {
    color: #6c757d;
}

.timings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.timing-item {
    padding: 18px;
    background: #f7fafc;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.timing-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timing-label {
    font-size: 0.95em;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 500;
    text-transform: capitalize;
}

.timing-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #667eea;
}

.error-section {
    margin-top: 35px;
    padding-top: 35px;
    border-top: 2px solid #e2e8f0;
}

.error-message {
    padding: 18px 20px;
    background: #fff5f5;
    color: #742a2a;
    border-radius: 10px;
    border-left: 4px solid #f56565;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.error-message::before {
    content: "⚠️";
    font-size: 1.3em;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    header {
        padding: 35px 25px;
    }
    
    .header-icon {
        font-size: 2.5em;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .subtitle {
        font-size: 1em;
    }
    
    main {
        padding: 25px;
    }
    
    .input-wrapper {
        flex-direction: column;
    }
    
    #validate-btn {
        width: 100%;
        justify-content: center;
    }
    
    .signals-grid, .timings-grid {
        grid-template-columns: 1fr;
    }
    
    .checks-list h3, .signals-section h3, .timings-section h3 {
        font-size: 1.2em;
    }
}




