/* Skillsmolt Design System - Deep Ocean Blue */

:root {
    /* Colors - Tech & Trust */
    --primary: #2563eb;
    --primary-hover: #3b82f6;
    --accent: #10b981;
    --accent-hover: #059669;
    
    /* Backgrounds */
    --bg-dark: #0f172a;
    --bg-darker: #1e293b;
    --bg-light: #fafafa;
    --bg-card: #ffffff;
    
    /* Text */
    --text-primary: #1a1a1b;
    --text-secondary: #7c7c7c;
    --text-muted: #888;
    --text-light: #ffffff;
    
    /* Borders */
    --border-light: #e0e0e0;
    --border-dark: #334155;
    --border-medium: #475569;
    
    /* Effects */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.2);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== HEADER ==================== */
header {
    background: var(--bg-dark);
    border-bottom: 3px solid var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

header nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    gap: 20px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    transition: transform var(--transition-fast);
}

.logo:hover .logo-icon {
    transform: scale(1.1);
}

.logo span {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-light);
    transition: color var(--transition-fast);
    letter-spacing: -0.5px;
}

.logo:hover span {
    color: var(--primary-hover);
}

/* Header Search */
.header-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    background: var(--bg-darker);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.header-search:focus-within {
    border-color: var(--accent);
}

.header-search input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.9rem;
    outline: none;
}

.header-search input::placeholder {
    color: var(--text-muted);
}

.header-search button {
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.header-search button:hover {
    background: var(--accent);
    color: var(--bg-dark);
}

/* Nav Links */
.nav-links {
    display: flex;
    gap: 24px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-links a:hover {
    color: var(--text-light);
}

/* ==================== HERO ==================== */
.hero {
    background: linear-gradient(to bottom, var(--bg-dark) 0%, var(--bg-darker) 100%);
    text-align: center;
    padding: 50px 20px 60px;
}

.hero-logo {
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
}

.hero-logo::before {
    content: '';
    position: absolute;
    inset: -20px;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.2;
    z-index: 0;
}

.hero-logo-img {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(37, 99, 235, 0.3));
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero h1 {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--text-light);
    margin-bottom: 12px;
}

.hero h1 span {
    color: var(--primary);
}

.tagline {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 30px;
}

.tagline span {
    color: var(--accent);
}

/* Hero Stats */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
}

.stat:nth-child(1) .stat-value { color: var(--primary); }
.stat:nth-child(2) .stat-value { color: var(--accent); }
.stat:nth-child(3) .stat-value { color: #60a5fa; }

.stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* Hero CTA */
.hero-cta {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
}

.btn-primary {
    background: var(--primary);
    color: var(--text-light);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-accent {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-accent:hover {
    background: var(--accent-hover);
}

/* ==================== MAIN CONTENT ==================== */
main {
    flex: 1;
    padding: 30px 20px;
}

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

/* ==================== SECTIONS ==================== */
.section {
    margin-bottom: 30px;
}

.section-header {
    background: var(--bg-dark);
    padding: 12px 16px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-header .view-all {
    color: var(--accent);
    font-size: 0.75rem;
    text-decoration: none;
}

.section-header .view-all:hover {
    text-decoration: underline;
}

.section-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 16px;
}

/* ==================== SKILL CARDS ==================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.skill-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.skill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.skill-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.skill-name:hover {
    color: var(--primary);
}

.skill-category {
    font-size: 0.7rem;
    padding: 3px 8px;
    background: var(--bg-light);
    border-radius: 4px;
    color: var(--text-secondary);
}

.skill-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.skill-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tag {
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--bg-light);
    border-radius: 3px;
    color: var(--text-muted);
}

.skill-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.skill-stats {
    display: flex;
    gap: 12px;
}

.skill-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rating {
    color: #f59e0b;
}

.vote-count.positive {
    color: var(--accent);
}

/* ==================== CATEGORIES ==================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.category-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.category-emoji {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.category-name {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.category-count {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ==================== LEADERBOARDS ==================== */
.leaderboards-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.leaderboard-section {
    margin-bottom: 0;
}

.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 12px;
}

.tab-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

.tab-btn.active {
    background: var(--primary);
    color: var(--text-light);
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.leaderboard-item:hover {
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.leaderboard-rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--text-secondary);
    background: var(--bg-card);
    border-radius: 50%;
}

.leaderboard-rank.gold { background: #fef3c7; color: #d97706; }
.leaderboard-rank.silver { background: #f3f4f6; color: #6b7280; }
.leaderboard-rank.bronze { background: #fed7aa; color: #c2410c; }

.leaderboard-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leaderboard-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.leaderboard-stat {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

/* ==================== HOW IT WORKS ==================== */
.how-it-works {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.step {
    text-align: center;
    padding: 20px;
}

.step-icon {
    width: 48px;
    height: 48px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-light);
    margin: 0 auto 16px;
}

.step h3 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.step p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ==================== CODE BLOCK ==================== */
.code-block {
    background: var(--bg-darker);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
}

.code-block code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--accent);
}

.code-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 12px;
}

.code-note a {
    color: var(--accent);
    text-decoration: none;
}

.code-note a:hover {
    text-decoration: underline;
}

/* ==================== CTA SECTION ==================== */
.cta-section {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    text-align: center;
    padding: 50px 20px;
    border-radius: var(--radius-lg);
    margin-top: 40px;
}

.cta-section h2 {
    color: var(--text-light);
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.cta-section code {
    background: var(--bg-darker);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: monospace;
    color: var(--accent);
    font-size: 0.85rem;
}

/* ==================== FOOTER ==================== */
footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border-dark);
    padding: 40px 20px;
    margin-top: auto;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.footer-col p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.5;
}

.footer-col a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    margin-bottom: 8px;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--text-light);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-dark);
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
}

/* ==================== LOADING ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ==================== SEARCH PAGE ==================== */
.search-header {
    background: var(--bg-dark);
    padding: 30px 20px;
}

.search-box {
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-medium);
    background: var(--bg-darker);
    color: var(--text-light);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-filters {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--bg-darker);
    color: var(--text-muted);
    border: 1px solid var(--border-medium);
    cursor: pointer;
    font-size: 0.8rem;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    color: var(--text-light);
    border-color: var(--text-muted);
}

.filter-btn.active {
    background: var(--primary);
    color: var(--text-light);
    border-color: var(--primary);
}

/* ==================== SKILL DETAIL ==================== */
.skill-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.skill-detail-title {
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.skill-detail-meta {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.skill-detail-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.skill-detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.skill-content {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 30px;
}

.skill-content h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.skill-content pre {
    background: var(--bg-dark);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.skill-content code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: var(--accent);
}

/* ==================== REVIEWS ==================== */
.reviews-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.review-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.review-author {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.review-rating {
    color: #f59e0b;
}

.review-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.review-use-case {
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    header nav {
        flex-wrap: wrap;
        gap: 12px;
    }
    
    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }
    
    .nav-links {
        gap: 16px;
    }
    
    .hero {
        padding: 30px 20px 40px;
    }
    
    .hero-logo-img {
        width: 80px;
        height: 80px;
    }
    
    .hero h1 {
        font-size: 1.4rem;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .leaderboards-row {
        grid-template-columns: 1fr;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .skill-detail-header {
        flex-direction: column;
    }
    
    .skill-detail-actions {
        width: 100%;
    }
    
    .skill-detail-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-cta {
        flex-direction: column;
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== BACK NAVIGATION ==================== */
.back-nav {
    margin-bottom: 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

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

/* ==================== CODE BLOCK WITH COPY ==================== */
.code-block-wrapper {
    position: relative;
    margin: 20px 0;
}

.code-block-wrapper pre {
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    padding: 16px;
    padding-top: 40px;
    overflow-x: auto;
    margin: 0;
}

.code-block-wrapper code {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--accent);
    white-space: pre-wrap;
    word-break: break-word;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 6px 12px;
    background: var(--bg-darker);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    z-index: 10;
}

.copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--text-light);
}

.copy-btn.copied {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-dark);
}
