/* Memory Leak Detector Styles */
.memory-leak-detector {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.detector-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Panel Styles */
.code-panel,
.results-panel {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

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

.header-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: #ffffff;
    flex-shrink: 0;
}

.header-text {
    flex: 1;
    min-width: 0;
}

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.4;
}

.panel-subtitle {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0 0;
    line-height: 1.4;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* Code Editor */
.code-editor-wrapper {
    flex: 1;
    position: relative;
    min-height: 400px;
    background: #1e1e1e;
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Panel Footer */
.panel-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* Action Buttons */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

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

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

.action-btn.secondary {
    background: #ffffff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.action-btn.secondary:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

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

.btn-text {
    flex: 1;
    text-align: center;
}

.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.6s linear infinite;
}

.action-btn.loading .btn-text {
    opacity: 0.7;
}

.action-btn.loading .btn-loader {
    display: block;
}

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

/* Results Content */
.results-content {
    flex: 1;
    padding: 1.5rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1.5rem;
    min-height: 400px;
    color: #6b7280;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    color: #d1d5db;
}

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

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

/* Analysis Results */
.score-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 1.5rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin: 0.5rem 0;
}

.score-label {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0.5rem 0 0 0;
}

.score-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.score-stat {
    flex: 1;
}

.score-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.score-stat-label {
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0.25rem 0 0 0;
}

.issue-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.issue-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.issue-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.issue-item.critical {
    border-left: 4px solid #ef4444;
}

.issue-item.warning {
    border-left: 4px solid #f59e0b;
}

.issue-item.info {
    border-left: 4px solid #3b82f6;
}

.issue-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.issue-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.issue-icon.critical {
    color: #ef4444;
}

.issue-icon.warning {
    color: #f59e0b;
}

.issue-icon.info {
    color: #3b82f6;
}

.issue-content {
    flex: 1;
    min-width: 0;
}

.issue-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.25rem 0;
}

.issue-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.5rem 0;
    line-height: 1.5;
}

.issue-fix {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.issue-fix-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.25rem 0;
}

.issue-fix-text {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.5;
}

.recommendations-card {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

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

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

.recommendations-list li {
    font-size: 0.875rem;
    color: #1e3a8a;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.5;
}

.recommendations-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: 600;
}

.success-message {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    color: #166534;
}

.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: #22c55e;
}

.success-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.success-text {
    font-size: 0.9375rem;
    margin: 0;
    opacity: 0.9;
}

/* Educational Content */
.educational-content {
    margin-top: 3rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.info-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #ffffff;
    flex-shrink: 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.card-body {
    margin-top: 1rem;
}

.card-text {
    font-size: 0.9375rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0;
}

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

.card-list li {
    font-size: 0.9375rem;
    color: #4b5563;
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.6;
}

.card-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: 600;
    font-size: 1.25rem;
    line-height: 1;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .detector-layout {
        grid-template-columns: 1fr;
    }

    .code-panel,
    .results-panel {
        min-height: 500px;
    }

    .code-editor-wrapper {
        min-height: 350px;
    }

    .results-content {
        max-height: none;
    }
}

@media (max-width: 767px) {
    .memory-leak-detector {
        margin-top: 1.5rem;
    }

    .detector-layout {
        gap: 1rem;
    }

    .panel-header {
        padding: 1rem;
        flex-wrap: wrap;
    }

    .header-content {
        width: 100%;
        margin-bottom: 0.75rem;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .action-btn.secondary {
        width: auto;
    }

    .code-editor-wrapper {
        min-height: 300px;
    }

    .code-panel,
    .results-panel {
        min-height: 450px;
    }

    .results-content {
        padding: 1rem;
    }

    .empty-state {
        padding: 2rem 1rem;
        min-height: 300px;
    }

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

    .score-card {
        padding: 1.25rem;
    }

    .score-value {
        font-size: 2.5rem;
    }

    .score-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .panel-title {
        font-size: 1rem;
    }

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

    .action-btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }

    .issue-item {
        padding: 1rem;
    }

    .score-value {
        font-size: 2rem;
    }
}
