/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4F46E5;
    --primary-dark: #4338CA;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--gray-800);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
    color: white;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Input Section */
.input-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

#urlInput {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}

#urlInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#urlInput::placeholder {
    color: var(--gray-400);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-300);
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.input-hint {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Progress Section */
.progress-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 999px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: var(--gray-600);
    font-weight: 500;
}

/* Error Section */
.error-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.error-content {
    text-align: center;
    padding: 2rem;
}

.error-content svg {
    margin: 0 auto 1rem;
}

.error-content h3 {
    color: var(--danger);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.error-content p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Results Section */
.results-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Score Card */
.score-card {
    background: white;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.score-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
}

.score-circle {
    transition: stroke-dashoffset 1s ease;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    font-weight: 700;
}

.score-max {
    font-size: 1.5rem;
    color: var(--gray-400);
}

#scoreTitle {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

#scoreDescription {
    color: var(--gray-600);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

.meta-info {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.meta-info span {
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border-radius: 0.5rem;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border-left: 4px solid;
}

.summary-card.high {
    border-left-color: var(--danger);
}

.summary-card.medium {
    border-left-color: var(--warning);
}

.summary-card.low {
    border-left-color: var(--info);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.summary-card.high .summary-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.summary-card.medium .summary-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.summary-card.low .summary-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.summary-content {
    display: flex;
    flex-direction: column;
}

.summary-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.summary-label {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Issues Container */
.issues-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h3 {
    font-size: 1.5rem;
    color: var(--gray-800);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--gray-600);
    transition: all 0.2s;
}

.filter-btn.active {
    background: white;
    color: var(--gray-800);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover:not(.active) {
    color: var(--gray-800);
}

/* Issues List */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.issue-item {
    border: 1px solid var(--gray-200);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s;
    border-left: 4px solid;
}

.issue-item:hover {
    box-shadow: var(--shadow-md);
}

.issue-item.priority-high {
    border-left-color: var(--danger);
}

.issue-item.priority-medium {
    border-left-color: var(--warning);
}

.issue-item.priority-low {
    border-left-color: var(--info);
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    gap: 1rem;
}

.issue-title {
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--gray-800);
    flex: 1;
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.priority-badge.high {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.priority-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.priority-badge.low {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--gray-100);
    color: var(--gray-700);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.issue-why {
    color: var(--gray-600);
    margin-bottom: 1rem;
    font-style: italic;
}

.issue-suggestion {
    background: var(--gray-50);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    border-radius: 0.5rem;
    color: var(--gray-700);
}

.issue-suggestion strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

/* Details Container */
.details-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    margin-bottom: 2rem;
}

.details-container > h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--gray-800);
}

/* Accordion */
.accordion-item {
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 1rem 1.5rem;
    background: var(--gray-50);
    border: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-800);
    transition: all 0.2s;
}

.accordion-header:hover {
    background: var(--gray-100);
}

.accordion-icon {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.accordion-item.active .accordion-icon {
    transform: rotate(45deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-item.active .accordion-content {
    max-height: 2000px;
}

.accordion-content > div {
    padding: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--gray-700);
}

.detail-value {
    color: var(--gray-600);
    text-align: right;
}

.detail-list {
    list-style: none;
    margin-top: 0.5rem;
}

.detail-list li {
    padding: 0.5rem;
    background: var(--gray-50);
    margin-bottom: 0.5rem;
    border-radius: 0.375rem;
    word-break: break-all;
}

/* Actions Section */
.actions-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.9;
    margin-top: 4rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.footer-note {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

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

    .section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .filter-btn {
        flex: 1;
        padding: 0.5rem;
        font-size: 0.875rem;
    }

    .issue-header {
        flex-direction: column;
    }

    .detail-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .detail-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .score-wrapper svg {
        width: 160px;
        height: 160px;
    }

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

/* Utility Classes */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.hidden {
    display: none !important;
}
