@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

:root {
    --bg-color: #0b0d19;
    --card-bg: rgba(18, 22, 41, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.4);
    --secondary: #10b981;
    --secondary-glow: rgba(16, 185, 129, 0.4);
    --accent: #f43f5e;
    
    --tag-bg-ai: rgba(139, 92, 246, 0.15);
    --tag-text-ai: #c084fc;
    --tag-bg-game: rgba(244, 63, 94, 0.15);
    --tag-text-game: #fb7185;
    --tag-bg-biz: rgba(16, 185, 129, 0.15);
    --tag-text-biz: #34d399;
    --tag-bg-utility: rgba(59, 130, 246, 0.15);
    --tag-text-utility: #60a5fa;
    --tag-bg-default: rgba(156, 163, 175, 0.15);
    --tag-text-default: #d1d5db;
    
    --font-main: 'Outfit', 'Noto Sans KR', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 10% 20%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 90% 80%, rgba(16, 185, 129, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    padding: 2rem 1.5rem;
    overflow-x: hidden;
}

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

/* Header Area */
header {
    margin-bottom: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo-section h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.logo-glow {
    text-shadow: 0 0 20px var(--primary-glow);
}

/* Add Button */
.btn-primary {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 0.8rem 1.6rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

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

/* Status Challenge Board */
.challenge-board {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.8rem;
    margin-bottom: 2.5rem;
    position: relative;
    overflow: hidden;
}

.challenge-board::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #8b5cf6, #10b981);
}

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

.challenge-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.2rem;
}

.challenge-count {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--secondary);
    text-shadow: 0 0 10px var(--secondary-glow);
}

.progress-container {
    background: rgba(255, 255, 255, 0.05);
    height: 12px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #10b981);
    box-shadow: 0 0 10px var(--primary-glow);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Control Panel (Search, Category, Tag filters) */
.controls-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.search-and-sort {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.search-box-wrapper {
    position: relative;
    flex: 1;
}

.search-box {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    border-radius: 12px;
    color: white;
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.sort-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Category Switcher Tabs */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.tab-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    background: rgba(139, 92, 246, 0.1);
    color: #c084fc;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

/* Tag filter cloud */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.tag-filter-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.tag-badge-filter {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.tag-badge-filter:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.tag-badge-filter.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 8px var(--primary-glow);
}

/* Main Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 1.8rem;
}

.web-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
    position: relative;
    overflow: hidden;
}

.web-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(139, 92, 246, 0.15);
}

.web-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient, linear-gradient(90deg, #8b5cf6, #10b981));
    opacity: 0.8;
}

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

.card-category {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

/* Dynamically styled categories */
.cat-ai { background: var(--tag-bg-ai); color: var(--tag-text-ai); }
.cat-game { background: var(--tag-bg-game); color: var(--tag-text-game); }
.cat-business { background: var(--tag-bg-biz); color: var(--tag-text-biz); }
.cat-utility { background: var(--tag-bg-utility); color: var(--tag-text-utility); }
.cat-default { background: var(--tag-bg-default); color: var(--tag-text-default); }

.card-status {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-active { color: #10b981; }
.status-active .status-dot { background-color: #10b981; box-shadow: 0 0 8px #10b981; }
.status-dev { color: #f59e0b; }
.status-dev .status-dot { background-color: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.status-planned { color: #9ca3af; }
.status-planned .status-dot { background-color: #9ca3af; }

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    line-height: 1.3;
}

.card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.2rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1.5rem;
}

.card-tag {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
}

.card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 1rem;
    margin-top: auto;
}

.btn-open {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    transition: var(--transition);
}

.btn-open:hover {
    background: white;
    color: var(--bg-color);
    transform: translateY(-1px);
}

.btn-edit {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 6px;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-edit:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 8, 17, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: #121629;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    width: 90%;
    max-width: 550px;
    padding: 2.2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px var(--primary-glow);
    transform: translateY(30px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.btn-close-modal:hover {
    color: white;
}

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

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

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    color: white;
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 2rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.75rem 1.4rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.75rem 1.4rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-right: auto;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--card-bg);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    grid-column: 1 / -1;
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    max-width: 300px;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding: 1.5rem 1rem;
    }
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    .search-and-sort {
        flex-direction: column;
    }
}

/* Sandbox Drawer Styles */
.sandbox-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100%;
    background: #0f1225;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 2rem 1.8rem;
}

.sandbox-drawer.active {
    right: 0;
}

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

.sandbox-title {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #f43f5e 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-close-sandbox {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.btn-close-sandbox:hover {
    color: white;
}

.sandbox-form {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.sandbox-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 0.5rem;
}

/* Custom scrollbar for sandbox list */
.sandbox-list::-webkit-scrollbar {
    width: 6px;
}
.sandbox-list::-webkit-scrollbar-track {
    background: transparent;
}
.sandbox-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.sandbox-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.idea-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 1rem;
    transition: var(--transition);
    position: relative;
}

.idea-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(244, 63, 94, 0.3);
}

.idea-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.idea-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

.idea-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.btn-convert-idea {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 0.35rem 0.7rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-convert-idea:hover {
    background: #10b981;
    color: white;
}

.btn-delete-idea {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-delete-idea:hover {
    color: var(--accent);
    background: rgba(244, 63, 94, 0.1);
}

/* Backdrop for drawer */
.drawer-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

@media (max-width: 480px) {
    .sandbox-drawer {
        width: 100%;
        right: -100%;
    }
}
