/* Error Log Analyzer Styles */

/* Error Log Analyzer Container */
.error-log-analyzer {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.analyzer-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
}

.input-card,
.results-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

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

.card-header-modern {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-wrapper svg {
    color: #ffffff;
}

.header-text {
    flex: 1;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #ffffff;
}

.card-subtitle {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
    color: #ffffff;
}

.card-body-modern {
    padding: 1.5rem;
}

/* Format Selector */
.format-selector-wrapper {
    margin-bottom: 1.25rem;
}

.format-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.format-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23374151' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.format-select:hover {
    border-color: #667eea;
}

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

/* Textarea */
.textarea-wrapper {
    position: relative;
    margin-bottom: 1.25rem;
}

.log-textarea {
    width: 100%;
    padding: 1rem;
    font-size: 0.875rem;
    
    line-height: 1.6;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #1f2937;
    resize: vertical;
    transition: all 0.2s ease;
    min-height: 200px;
}

.log-textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.log-textarea::placeholder {
    color: #9ca3af;
}

.textarea-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.char-count {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-primary-modern,
.btn-secondary-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

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

.btn-primary-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-primary-modern:active {
    transform: translateY(0);
}

.btn-primary-modern:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary-modern {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary-modern:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
}

.btn-loader {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-primary-modern.loading .btn-text {
    opacity: 0;
}

.btn-primary-modern.loading .btn-loader {
    display: block;
    position: absolute;
}

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

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
}

.results-card {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
}

.results-content {
    overflow-y: auto;
    padding: 0;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    min-height: 300px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    color: #9ca3af;
}

.empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.5rem 0;
}

.empty-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
    max-width: 280px;
}

/* Analysis Results */
.analysis-summary {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-left: 4px solid #667eea;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.summary-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

.stat-value.error {
    color: #dc2626;
}

.stat-value.warning {
    color: #f59e0b;
}

/* Error Categories */
.error-categories {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.category-badge.database {
    background: #fee2e2;
    color: #991b1b;
}

.category-badge.memory {
    background: #fef3c7;
    color: #92400e;
}

.category-badge.network {
    background: #dbeafe;
    color: #1e40af;
}

.category-badge.filesystem {
    background: #e0e7ff;
    color: #3730a3;
}

.category-badge.application {
    background: #fce7f3;
    color: #9f1239;
}

.category-count {
    font-weight: 700;
}

/* Error Files */
.error-files {
    margin-bottom: 1.5rem;
}

.file-item {
    padding: 1rem;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border-left: 3px solid #667eea;
}

.file-path {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
    
}

.file-error-count {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Recent Errors */
.recent-errors {
    margin-bottom: 1.5rem;
}

.error-item {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #dc2626;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
}

.error-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.error-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.error-level {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #fee2e2;
    color: #991b1b;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.error-timestamp {
    font-size: 0.75rem;
    color: #6b7280;
}

.error-line {
    font-size: 0.75rem;
    color: #6b7280;
}

.error-message {
    font-size: 0.9375rem;
    color: #1f2937;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.error-location {
    font-size: 0.75rem;
    color: #667eea;
    
}

/* Recommendations */
.recommendations {
    margin-bottom: 1.5rem;
}

.recommendation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommendation-item {
    padding: 0.875rem 1rem;
    background: #f0f9ff;
    border-left: 3px solid #0ea5e9;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #0c4a6e;
    line-height: 1.6;
}

.recommendation-item::before {
    content: "💡";
    margin-right: 0.5rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .analyzer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .results-card {
        position: static;
        max-height: none;
    }

    .results-content {
        max-height: 600px;
    }
}

@media (max-width: 768px) {
    .error-log-analyzer {
        margin-top: 1.5rem;
    }

    .analyzer-container {
        gap: 1.25rem;
    }

    .card-header-modern {
        padding: 1rem 1.25rem;
    }

    .card-body-modern {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 1.125rem;
    }

    .card-subtitle {
        font-size: 0.8125rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-primary-modern,
    .btn-secondary-modern {
        width: 100%;
    }

    .summary-stats {
        grid-template-columns: 1fr 1fr;
    }

    .empty-state {
        padding: 2rem 1.5rem;
        min-height: 250px;
    }

    .empty-icon {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 480px) {
    .icon-wrapper {
        width: 36px;
        height: 36px;
    }

    .format-select {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    .log-textarea {
        font-size: 0.8125rem;
        padding: 0.875rem;
    }

    .summary-stats {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar Styling */
.results-content::-webkit-scrollbar {
    width: 8px;
}

.results-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.results-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.results-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
