/* Troy Coverage Analyzer Styles */
.troy-coverage-analyzer {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.troy-coverage-analyzer * {
    box-sizing: border-box;
}

/* Title */
.troy-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 30px 0;
    text-align: center;
}

/* Section 1: Input Area */
.troy-input-section {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.troy-input-methods {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .troy-input-methods {
        grid-template-columns: 2fr 1fr;
    }
}

.troy-textarea-wrapper label,
.troy-file-upload-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.troy-json-textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    transition: border-color 0.3s;
}

.troy-json-textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.troy-file-input {
    width: 100%;
    padding: 10px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.troy-file-input:hover {
    border-color: #0073aa;
}

/* Action Buttons */
.troy-action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.troy-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.troy-btn-primary {
    background: #0073aa;
    color: #fff;
}

.troy-btn-primary:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,115,170,0.3);
}

.troy-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.troy-btn-secondary:hover {
    background: #e0e0e0;
}

.troy-btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

/* Loading & Error Messages */
.troy-loading {
    text-align: center;
    padding: 20px;
    color: #0073aa;
    font-weight: 600;
}

.troy-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 3px solid rgba(0,115,170,0.3);
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: troy-spin 0.8s linear infinite;
}

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

.troy-error-message {
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    color: #856404;
    font-weight: 600;
}

/* Section 2: Output Area */
.troy-output-section {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.troy-output-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 1024px) {
    .troy-output-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.troy-output-box {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.troy-output-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e0e0e0;
}

.troy-output-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.troy-output-actions {
    display: flex;
    gap: 10px;
}

.troy-output-textarea {
    width: 100%;
    min-height: 400px;
    padding: 15px;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    background: #fafafa;
}

.troy-output-textarea:focus {
    outline: none;
    background: #fff;
}

/* Section 3: Statistics */
.troy-stats-section {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.troy-stats-section h3 {
    margin: 0 0 25px 0;
    font-size: 22px;
    color: #333;
    text-align: center;
}

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

.troy-stat-item {
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s;
}

.troy-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.1);
}

.troy-stat-original {
    border-color: #6c757d;
}

.troy-stat-covered {
    border-color: #28a745;
    background: #f1f9f3;
}

.troy-stat-uncovered {
    border-color: #dc3545;
    background: #fef5f6;
}

.troy-stat-saved {
    border-color: #0073aa;
    background: #f0f7fb;
}

.troy-stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.troy-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.troy-stat-percent {
    font-size: 24px;
    font-weight: 700;
    color: #0073aa;
}

/* Copy Success Animation */
@keyframes troy-copy-success {
    0% { background: #28a745; }
    100% { background: #0073aa; }
}

.troy-copy-success {
    animation: troy-copy-success 0.5s;
}

/* Responsive */
@media (max-width: 767px) {
    .troy-coverage-analyzer {
        padding: 0 10px;
    }
    
    .troy-input-section,
    .troy-output-section,
    .troy-stats-section {
        padding: 20px;
    }
    
    .troy-title {
        font-size: 22px;
    }
    
    .troy-output-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .troy-output-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
