:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --accent: #f97316;
    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #2d2d4a;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #1e3a5f 100%);
    padding: 3rem 1.5rem;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

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

.rocket-icon {
    font-size: 2.5rem;
    cursor: pointer;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
    transition: transform 0.2s;
}

.rocket-icon:hover {
    transform: scale(1.2);
}

.rocket-icon.celebrating {
    animation: celebrate 0.5s ease-in-out infinite;
}

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

@keyframes celebrate {
    0%, 100% { transform: rotate(-15deg) scale(1.3); }
    50% { transform: rotate(15deg) scale(1.3); }
}

.app-header h1 {
    font-size: clamp(1.75rem, 5vw, 3rem);
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 1.125rem;
    color: #a5b4fc;
    font-weight: 400;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1.5rem;
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 2rem;
}

/* Projects Column */
.projects-column {
    min-width: 0;
}

/* Submit Section */
.submit-section {
    margin-bottom: 1.5rem;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.submit-toggle {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}

.submit-toggle:hover {
    background: var(--bg-card-hover);
}

.toggle-hint {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.submit-form {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.char-count {
    float: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
}

.optional {
    color: var(--text-secondary);
    font-weight: 400;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-group input::placeholder {
    color: #475569;
}

.launch-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent) 0%, #ea580c 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.4);
}

.launch-btn:active {
    transform: translateY(0);
}

/* Controls */
.controls-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sort-pills {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.375rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.sort-pill {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-pill:hover {
    color: var(--text-primary);
}

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

.search-wrapper {
    flex: 1;
    min-width: 200px;
}

.search-input {
    width: 100%;
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-input::placeholder {
    color: #475569;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Project Card */
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.project-card.hovered {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.project-avatar {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    border-radius: 10px;
}

.project-time {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.card-body {
    margin-bottom: 1rem;
}

.project-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.project-name.linked {
    text-decoration: none;
    display: inline-block;
    transition: color 0.2s;
}

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

.project-description {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.upvote-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.upvote-btn.upvoted {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.2) 0%, rgba(234, 88, 12, 0.2) 100%);
    border-color: var(--accent);
    color: var(--accent);
}

.upvote-icon {
    transition: transform 0.2s;
}

.upvote-btn:active .upvote-icon {
    transform: scale(1.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: 16px;
    border: 1px dashed var(--border);
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* Sidebar */
.stats-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-card,
.vibe-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
}

.stats-card h3,
.vibe-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.stat-item:last-child {
    margin-bottom: 0;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.vibe-message {
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.5;
}

.fun-fact {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 1rem;
    font-size: 0.9375rem;
    color: #a5b4fc;
    text-align: center;
}

/* Footer */
.app-footer {
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.app-footer p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.app-footer a:hover {
    color: #818cf8;
}

.footer-inspired {
    font-size: 0.75rem;
    color: #475569;
}

/* Confetti */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-particle {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 2s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Toast */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--primary);
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    z-index: 1000;
    animation: toast-in 0.3s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .stats-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 640px) {
    .app-header {
        padding: 2rem 1rem;
    }
    
    .header-title {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .controls-bar {
        flex-direction: column;
    }
    
    .sort-pills {
        width: 100%;
        justify-content: center;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-sidebar {
        grid-template-columns: 1fr;
    }
}