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

body {
    background: linear-gradient(135deg, #fef7f0 0%, #fff5f5 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1e293b;
    line-height: 1.6;
}

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

header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

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

.logo {
    height: 64px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 1;
}

.nav-tabs {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    padding-bottom: 1rem;
}

.nav-tab {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.nav-tab:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.nav-tab.active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    font-weight: 600;
}

.page-title h2 {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.page-title p {
    color: #64748b;
    font-size: 1rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

header p {
    font-size: 1.125rem;
    color: #64748b;
    font-weight: 400;
}

/* Card Styles */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(239, 68, 68, 0.1);
    transition: all 0.2s ease;
    margin-top: 1.5rem;
}

.card:hover {
    box-shadow: 0 8px 32px rgba(239, 68, 68, 0.15);
    transform: translateY(-2px);
    border-color: rgba(239, 68, 68, 0.2);
}

.card h2 {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    padding-bottom: 0.75rem;
}

/* Upload Section */
.upload-section {
    max-width: 600px;
    margin: 0 auto 3rem;
    text-align: center;
}

.upload-container {
    background: rgba(239, 68, 68, 0.05);
    border: 2px dashed rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.upload-container:hover {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.08);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.upload-text {
    font-size: 1.125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.upload-subtext {
    font-size: 0.875rem;
    color: #64748b;
    margin: 0;
}

.search-container {
    margin-bottom: 1.5rem;
}

.start-analysis-btn {
    width: 100%;
    max-width: 400px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.start-analysis-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

#username {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.2s ease;
    outline: none;
    text-align: center;
}

#username:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}



#analyze-btn:active {
    transform: translateY(0);
}

/* Profile Overview */
.profile-content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: start;
}

.profile-image img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
}

.profile-details h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #0f172a;
}

.profile-details p {
    color: #64748b;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.stats {
    display: flex;
    gap: 1rem;
}

.stat {
    text-align: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 8px;
    min-width: 80px;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #0f172a;
}

.stat-label {
    color: #64748b;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Profile Rating Styles */
.profile-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rating-circle {
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 0.5rem;
}

.rating-progress {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        var(--rating-color, #10b981) 0deg,
        var(--rating-color, #10b981) calc(var(--rating-percentage, 0%) * 3.6deg),
        #e5e7eb calc(var(--rating-percentage, 0%) * 3.6deg),
        #e5e7eb 360deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: white;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rating-score {
    font-size: 1rem;
    font-weight: 600;
    color: var(--rating-color, #10b981);
    line-height: 1;
}

.rating-label {
    font-size: 0.625rem;
    color: #64748b;
    margin-top: 1px;
}

.rating-description {
    font-size: 0.75rem;
    color: var(--rating-color, #10b981);
    text-align: center;
    font-weight: 500;
}

/* Chart Containers */
.chart-container {

    position: relative;
    height: 300px;
    margin-top: 5px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.half-width {
    margin-bottom: 0;
}

/* Filter Container */
.filter-container {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-container label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
}

.filter-container select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease;
}

.filter-container select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Loading and Error States */
.hidden {
    display: none !important;
}

#loading {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #ef4444;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#loading p {
    color: #64748b;
    font-size: 0.875rem;
}

#error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

/* GitHub Stats Styles */
.github-stats {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}

.stats-grid {
    display: grid;
    gap: 0.75rem;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.stats-item:hover {
    transform: translateX(2px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stats-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.stats-label {
    flex: 1;
    color: #374151;
    font-size: 0.875rem;
}

.stats-value {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.875rem;
}

/* Language Bar Styles */
.language-bar-container {
    padding: 1rem 0;
}

.language-bar {
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    margin-bottom: 1rem;
    background: #f1f5f9;
}

.language-segment {
    height: 100%;
}

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

.language-item {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    color: #64748b;
}

.language-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Repository Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: white;
}

.metric-title {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.25rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1;
}

.metric-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.25rem;
}

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

    .header-logo {
        flex-direction: column;
        gap: 0.5rem;
    }

    .header-logo h1 {
        font-size: 1.75rem;
    }

    .nav-tabs {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }

    .page-title h2 {
        font-size: 1.5rem;
    }

    .upload-container {
        padding: 1.5rem 1rem;
    }

    .chart-row {
        grid-template-columns: 1fr;
    }
    
    .profile-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    
    .stats {
        justify-content: center;
        flex-wrap: wrap;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .language-legend {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1rem;
    }
}

/* AI Insights Styles */
.insights-container {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
    min-height: 100px;
}

.loading-insight p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

.insight-card {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    border-left: 3px solid #10b981;
    margin-bottom: 1rem;
}

.insight-card.scoring {
    border-left-color: #3b82f6;
}

.insight-card.recommendations {
    border-left-color: #f59e0b;
}

.insight-card.strengths {
    border-left-color: #10b981;
}

.insight-card.improvements {
    border-left-color: #ef4444;
}

.insight-title {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.75rem;
}

.insight-content {
    color: #64748b;
    line-height: 1.5;
    font-size: 0.875rem;
}

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

.insight-list li {
    margin-bottom: 0.5rem;
    padding-left: 1rem;
    position: relative;
    font-size: 0.875rem;
}

.insight-list li::before {
    content: '•';
    color: #10b981;
    font-weight: 600;
    position: absolute;
    left: 0;
}


/* Download Container */
.download-container {
    text-align: center;
    margin-bottom: 2rem;
}

.download-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.download-btn:hover {
    background: linear-gradient(135deg, #dc2626 0%, #ea580c 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}























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

.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #ef4444;
    outline-offset: 2px;
}

button:focus,
input:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Smooth transitions */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}