/* ============================================
   CSS Variables & Theme
   ============================================ */
:root {
    /* Colors - Dark Theme with Orange Accent */
    --bg-primary: #0d0a06;
    --bg-secondary: #1a1510;
    --bg-tertiary: #252015;
    --bg-card: rgba(35, 30, 22, 0.7);
    --bg-card-hover: rgba(45, 38, 28, 0.85);
    
    /* Accent Colors */
    --accent-primary: #f97316;
    --accent-secondary: #fb923c;
    --accent-glow: rgba(249, 115, 22, 0.4);
    
    /* Text Colors */
    --text-primary: #fafaf9;
    --text-secondary: #a8a29e;
    --text-muted: #78716c;
    
    /* Border & Effects */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --glass-bg: rgba(35, 30, 22, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Background Effects
   ============================================ */
.bg-gradient {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(249, 115, 22, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(180, 83, 9, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse 100% 100% at 50% 50%, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    z-index: -2;
}

.bg-noise {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    z-index: -1;
    pointer-events: none;
}

/* ============================================
   Container & Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        padding: var(--spacing-2xl) var(--spacing-xl);
    }
}

/* ============================================
   Glass Card Effect
   ============================================ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
}

/* ============================================
   Header / Profile
   ============================================ */
.header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

@media (min-width: 640px) {
    .header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.profile {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.avatar-wrapper {
    position: relative;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border-color);
    object-fit: cover;
    transition: var(--transition-base);
}

.avatar:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #22c55e;
    border: 3px solid var(--bg-primary);
    border-radius: var(--radius-full);
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.username {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
}

.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-secondary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* ============================================
   Welcome Section
   ============================================ */
.welcome-section {
    margin-bottom: var(--spacing-xl);
}

.date {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.welcome-title {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

.greeting {
    color: var(--accent-primary);
    display: block;
}

.welcome-text {
    color: var(--text-primary);
}

.welcome-desc {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* ============================================
   Stats Section
   ============================================ */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.stat-icon {
    font-size: 1.5rem;
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

/* ============================================
   Projects Section
   ============================================ */
.projects-section {
    margin-bottom: var(--spacing-2xl);
}

.section-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

@media (min-width: 640px) {
    .section-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-title svg {
    color: var(--accent-primary);
}

.sort-controls {
    display: flex;
    gap: var(--spacing-xs);
    background: var(--bg-card);
    padding: 4px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.sort-btn {
    padding: var(--spacing-xs) var(--spacing-md);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}

.sort-btn:hover {
    color: var(--text-secondary);
}

.sort-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* ============================================
   Loading & Error States
   ============================================ */
.loading-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

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

.error-icon {
    font-size: 2rem;
}

.hidden {
    display: none !important;
}

/* ============================================
   Projects Grid
   ============================================ */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

/* ============================================
   Project Card
   ============================================ */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.project-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

.project-thumbnail {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    transition: var(--transition-slow);
}

.project-card:hover .project-thumbnail img {
    transform: scale(1.05);
}

.thumbnail-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.thumbnail-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.thumbnail-placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.5;
}

.project-content {
    padding: var(--spacing-md);
}

.project-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.project-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.project-name a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

.project-name a:hover {
    color: var(--accent-primary);
}

.project-language {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.language-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.project-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.625rem;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.meta-item svg {
    width: 14px;
    height: 14px;
}

.project-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-left: auto;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition-fast);
}

.action-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Language Colors
   ============================================ */
.lang-javascript { background-color: #f1e05a; }
.lang-typescript { background-color: #3178c6; }
.lang-html { background-color: #e34c26; }
.lang-css { background-color: #563d7c; }
.lang-scss { background-color: #c6538c; }
.lang-vue { background-color: #41b883; }
.lang-python { background-color: #3572A5; }
.lang-ruby { background-color: #701516; }
.lang-go { background-color: #00ADD8; }
.lang-rust { background-color: #dea584; }
.lang-java { background-color: #b07219; }
.lang-php { background-color: #4F5D95; }
.lang-swift { background-color: #F05138; }
.lang-kotlin { background-color: #A97BFF; }
.lang-shell { background-color: #89e051; }
.lang-default { background-color: #6e6e6e; }

/* ============================================
   Footer
   ============================================ */
.footer {
    text-align: center;
    padding: var(--spacing-xl) 0;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer a:hover {
    color: var(--accent-secondary);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 640px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .stat-item:last-child {
        border-bottom: none;
    }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: var(--accent-primary);
    color: white;
}

