:root {
    /* Exact color palette as specified */
    --antique-white: #ffedd8ff;
    --soft-apricot: #f3d5b5ff;
    --tan: #e7bc91ff;
    --light-bronze: #d4a276ff;
    --camel: #bc8a5fff;
    --faded-copper: #a47148ff;
    --toffee-brown: #8b5e34ff;
    --walnut: #6f4518ff;
    --walnut-2: #603808ff;
    --walnut-3: #583101ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--antique-white) 0%, var(--soft-apricot) 100%);
    min-height: 100vh;
    color: var(--walnut);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    background: linear-gradient(135deg, var(--camel), var(--faded-copper));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--walnut-2);
    opacity: 0.9;
}

/* Search Section */
.search-section {
    margin-bottom: 3rem;
}

.search-container {
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    max-width: 600px;
    width: 100%;
    display: flex;
    background: var(--antique-white);
    border-radius: 3rem;
    padding: 0.75rem 1.5rem 0.75rem 1rem;
    box-shadow: 
        0 10px 30px rgba(112, 69, 24, 0.15),
        0 4px 12px rgba(188, 138, 95, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    border-color: var(--camel);
    box-shadow: 
        0 20px 40px rgba(112, 69, 24, 0.2),
        0 8px 20px rgba(188, 138, 95, 0.15);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--walnut-2);
    font-size: 1.2rem;
    margin-right: 1rem;
    align-self: center;
}

#searchInput {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    color: var(--walnut);
    background: transparent;
    padding: 0.75rem 0;
}

#searchInput::placeholder {
    color: var(--walnut-2);
    opacity: 0.7;
}

.search-btn {
    background: linear-gradient(135deg, var(--camel), var(--faded-copper));
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(188, 138, 95, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--faded-copper), var(--toffee-brown));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(188, 138, 95, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* Loading Section */
.loading-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-container {
    text-align: center;
    color: var(--walnut-2);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--tan);
    border-top: 4px solid var(--camel);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Section */
.error-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.error-card {
    background: var(--antique-white);
    padding: 3rem 2.5rem;
    border-radius: 2rem;
    text-align: center;
    box-shadow: 
        0 20px 40px rgba(112, 69, 24, 0.15),
        0 8px 20px rgba(188, 138, 95, 0.1);
    max-width: 500px;
    width: 100%;
}

.error-icon {
    font-size: 4rem;
    color: var(--light-bronze);
    margin-bottom: 1rem;
}

.error-card h3 {
    font-size: 1.5rem;
    color: var(--walnut);
    margin-bottom: 0.5rem;
}

.error-card p {
    color: var(--walnut-2);
    margin-bottom: 2rem;
}

/* Profile Card */
.profile-section {
    margin-bottom: 3rem;
}

.profile-card {
    background: var(--antique-white);
    border-radius: 2.5rem;
    padding: 3rem;
    box-shadow: 
        0 25px 50px rgba(112, 69, 24, 0.15),
        0 10px 25px rgba(188, 138, 95, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(231, 188, 145, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 35px 70px rgba(112, 69, 24, 0.25),
        0 15px 35px rgba(188, 138, 95, 0.15);
}

.profile-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    align-items: flex-start;
}

.profile-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--camel);
    box-shadow: 0 10px 30px rgba(188, 138, 95, 0.3);
    transition: all 0.3s ease;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(188, 138, 95, 0.4);
}

.profile-info h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--walnut);
    margin-bottom: 0.5rem;
}

.profile-username {
    font-size: 1.3rem;
    color: var(--camel);
    font-weight: 600;
    margin-bottom: 1rem;
}

.profile-bio {
    font-size: 1.1rem;
    color: var(--walnut-2);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--camel);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    background: rgba(188, 138, 95, 0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.profile-link:hover {
    background: var(--camel);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(188, 138, 95, 0.4);
}

/* Stats */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: rgba(243, 213, 181, 0.2);
    border-radius: 1.5rem;
    border: 1px solid rgba(231, 188, 145, 0.3);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--faded-copper);
    line-height: 1;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--walnut-2);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profile Details */
.profile-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--walnut-2);
    font-weight: 500;
}

.detail-item i {
    color: var(--camel);
    width: 20px;
}

/* Repositories Section */
.repos-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--walnut);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.repos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
}

.repo-card {
    background: var(--antique-white);
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid rgba(231, 188, 145, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.repo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--camel), var(--faded-copper));
}

.repo-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(112, 69, 24, 0.2),
        0 10px 25px rgba(188, 138, 95, 0.15);
}

.repo-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--walnut);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.repo-name i {
    color: var(--camel);
}

.repo-desc {
    color: var(--walnut-2);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.repo-meta {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 0.95rem;
    color: var(--walnut-2);
}

.repo-stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.repo-link {
    color: var(--camel);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.repo-link:hover {
    color: var(--faded-copper);
}

/* Buttons */
.btn-secondary {
    background: rgba(188, 138, 95, 0.1);
    color: var(--camel);
    border: 2px solid rgba(188, 138, 95, 0.3);
    padding: 0.75rem 2rem;
    border-radius: 2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--camel);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(188, 138, 95, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .profile-avatar {
        width: 120px;
        height: 120px;
    }
    
    .profile-info h2 {
        font-size: 1.8rem;
    }
    
    .profile-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .profile-card {
        padding: 2rem;
    }
    
    .search-box {
        padding: 0.5rem 1rem 0.5rem 0.75rem;
    }
    
    .search-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .repos-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .repo-card {
        padding: 1.5rem;
    }
    
    .detail-item {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .profile-stats {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .profile-card {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .error-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }
}

/* Empty state for repos */
.empty-repos {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--walnut-2);
    grid-column: 1 / -1;
}

.empty-repos i {
    font-size: 4rem;
    color: var(--light-bronze);
    margin-bottom: 1rem;
}

.empty-repos h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--walnut);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-section,
.repos-section {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 239, 216, 0.5);
}

::-webkit-scrollbar-thumb {
    background: var(--camel);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--faded-copper);
}