/* ============================================
   VibeWorks - 바이브코딩 플랫폼 Stylesheet
   ============================================ */

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

:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --primary-bg: #F0EDFF;
    --secondary: #00B894;
    --accent: #FD79A8;
    --dark: #2D3436;
    --gray-900: #1a1a2e;
    --gray-800: #2d2d44;
    --gray-700: #4a4a5a;
    --gray-600: #636e72;
    --gray-500: #8395a7;
    --gray-400: #b2bec3;
    --gray-300: #dfe6e9;
    --gray-200: #f0f0f5;
    --gray-100: #f8f9fa;
    --white: #ffffff;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #27ae60;
    --info: #3498db;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --transition: 0.2s ease;
    --container: 1200px;
    --header-height: 64px;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--dark);
    background: var(--gray-100);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Header --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    z-index: 1000;
}

.header-inner {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 32px;
}

.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.gnb { display: flex; gap: 4px; flex: 1; justify-content: center; }
.gnb-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
    white-space: nowrap;
}
.gnb-link:hover { background: var(--primary-bg); color: var(--primary); }
.gnb-link.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.gnb-link .material-symbols-outlined { font-size: 20px; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-700);
    padding: 4px;
}

/* --- Mobile Menu --- */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--gray-300);
    z-index: 999;
    box-shadow: var(--shadow-md);
}
.mobile-menu.open { display: block; }
.mobile-nav { padding: 16px 20px; }
.mobile-nav-link {
    display: block;
    padding: 12px 0;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-200);
}
.mobile-nav-link:last-child { border-bottom: none; }
.mobile-nav hr { border: none; border-top: 1px solid var(--gray-300); margin: 8px 0; }

/* --- Main --- */
.main {
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }

.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-200); }

.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }

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

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-full { width: 100%; }

/* --- Cards --- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--gray-200);
}
.card-body { padding: 16px; }
.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-desc {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray-500);
}
.card-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* --- Badge --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-primary { background: var(--primary-bg); color: var(--primary); }
.badge-success { background: #d4edda; color: var(--success); }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: var(--danger); }
.badge-info { background: #d1ecf1; color: var(--info); }

/* --- Star Rating --- */
.star-rating { display: inline-flex; align-items: center; gap: 2px; }
.star-rating .star { color: var(--gray-400); font-size: 16px; }
.star-rating .star.filled { color: #f1c40f; }
.star-rating .rating-num { font-size: 0.85rem; color: var(--gray-600); margin-left: 4px; font-weight: 600; }

/* --- Forms --- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--white);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-hint { font-size: 0.8rem; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 4px; }

/* --- Hero Section --- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #4834d4 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}
.hero > * {
    position: relative;
    z-index: 1;
}
.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.3;
}
.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 32px;
    font-weight: 400;
    line-height: 1.6;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .btn-primary { background: var(--white); color: var(--primary); }
.hero .btn-primary:hover { background: var(--gray-100); }
.hero .btn-outline { border-color: var(--white); color: var(--white); }
.hero .btn-outline:hover { background: rgba(255,255,255,0.15); }

/* --- Category Cards (Homepage) --- */
.category-section { padding: 64px 0; }
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}
.section-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 48px;
    font-size: 1rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}
.category-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.category-icon {
    width: 72px;
    height: 72px;
    background: var(--primary-bg);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}
.category-icon .material-symbols-outlined { font-size: 36px; color: var(--primary); }
.category-card h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 12px; }
.category-card p { font-size: 0.9rem; color: var(--gray-600); line-height: 1.6; margin-bottom: 20px; }

/* --- Popular Services Section --- */
.popular-section { padding: 64px 0; background: var(--white); }

/* --- Stats Section --- */
.stats-section { padding: 48px 0; background: var(--primary-bg); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stat-item { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.9rem; color: var(--gray-600); margin-top: 4px; }

/* --- CTA Section --- */
.cta-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--primary) 0%, #4834d4 100%);
    color: var(--white);
    text-align: center;
}
.cta-section h2 { font-size: 2rem; font-weight: 800; margin-bottom: 16px; }
.cta-section p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 32px; }

/* --- Flash Messages --- */
.flash {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    animation: slideDown 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 500px;
    box-shadow: var(--shadow-md);
}
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }
.flash-info { background: #d1ecf1; color: #0c5460; }
.flash-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
}

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

/* --- Pagination --- */
.pagination { display: flex; justify-content: center; gap: 4px; padding: 32px 0; }
.page-link {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
}
.page-link:hover { background: var(--gray-200); }
.page-link.active { background: var(--primary); color: var(--white); }

/* --- Auth Pages --- */
.auth-container {
    max-width: 440px;
    margin: 60px auto;
    padding: 40px;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 8px;
}
.auth-subtitle {
    text-align: center;
    color: var(--gray-600);
    margin-bottom: 32px;
    font-size: 0.9rem;
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--gray-500);
    font-size: 0.85rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-300);
}
.social-btn {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--gray-300);
    background: var(--white);
    margin-bottom: 10px;
}
.social-btn:hover { background: var(--gray-100); }
.social-btn.kakao { background: #FEE500; border-color: #FEE500; color: #191919; }
.social-btn.kakao:hover { background: #FFEB33; }

/* --- Footer --- */
.footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 48px 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}
.footer-title { font-size: 1.25rem; font-weight: 800; color: var(--white); margin-bottom: 12px; }
.footer-desc { font-size: 0.875rem; line-height: 1.6; margin-bottom: 8px; }
.footer-company { font-size: 0.8rem; }
.footer-subtitle { font-size: 0.9rem; font-weight: 600; color: var(--white); margin-bottom: 12px; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 0.85rem; transition: var(--transition); }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
    border-top: 1px solid var(--gray-800);
    padding-top: 24px;
    font-size: 0.8rem;
    text-align: center;
}

/* --- Detail Page --- */
.page-header {
    background: var(--white);
    padding: 32px 0;
    border-bottom: 1px solid var(--gray-300);
}
.page-header h1 { font-size: 1.75rem; font-weight: 800; }
.breadcrumb {
    display: flex;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}
.breadcrumb a:hover { color: var(--primary); }

.content-section { padding: 40px 0; }
.content-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    align-items: start;
}
.sidebar-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    position: sticky;
    top: calc(var(--header-height) + 20px);
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.filter-bar .form-select {
    width: auto;
    min-width: 140px;
}
.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    flex: 1;
    max-width: 400px;
}
.search-box input {
    border: none;
    outline: none;
    padding: 10px 0;
    font-size: 0.95rem;
    flex: 1;
    font-family: inherit;
}
.search-box .material-symbols-outlined { color: var(--gray-500); }

/* --- Profile --- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}
.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}
.profile-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 4px; }
.profile-bio { color: var(--gray-600); font-size: 0.9rem; }
.profile-stats { display: flex; gap: 24px; margin-top: 12px; }
.profile-stat { text-align: center; }
.profile-stat-num { font-size: 1.25rem; font-weight: 700; color: var(--primary); }
.profile-stat-label { font-size: 0.8rem; color: var(--gray-500); }

/* --- Tags --- */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    padding: 4px 12px;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- Tables --- */
.table-responsive { overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
}
.table th, .table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    font-size: 0.9rem;
}
.table th {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
}
.table tr:hover td { background: var(--gray-100); }

/* --- Status --- */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-pending { background: #fff3cd; color: #856404; }
.status-pending::before { background: #f39c12; }
.status-progress { background: #d1ecf1; color: #0c5460; }
.status-progress::before { background: #3498db; }
.status-complete { background: #d4edda; color: #155724; }
.status-complete::before { background: #27ae60; }
.status-dispute { background: #f8d7da; color: #721c24; }
.status-dispute::before { background: #e74c3c; }

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray-500);
}
.empty-state .material-symbols-outlined { font-size: 64px; color: var(--gray-400); margin-bottom: 16px; }
.empty-state h3 { font-size: 1.2rem; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p { font-size: 0.9rem; margin-bottom: 24px; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .content-grid { grid-template-columns: 1fr; }
    .sidebar-card { position: static; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .gnb { display: none; }
    .mobile-menu-btn { display: block; }
    .header-actions .btn { display: none; }
    .header-actions .mobile-menu-btn { display: flex; }
    .hero-title { font-size: 1.75rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero { padding: 48px 0; overflow: visible; }
    .hero::before { display: none; }
    .hero-actions { flex-direction: column; align-items: center; gap: 10px; }
    .hero-actions .btn { width: 100%; max-width: 280px; text-align: center; }
    .category-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .card-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-stats { justify-content: center; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .auth-container { margin: 20px; padding: 24px; }
    .section-title { font-size: 1.4rem; }
    .page-header h1 { font-size: 1.3rem; }
    .page-header .btn { display: none; }
    .mobile-cta { display: block !important; }
    .form-grid-3 { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.5rem; }
    .card-img { height: 160px; }
    .btn-lg { padding: 12px 20px; font-size: 0.95rem; }
    .btn-full-mobile { width: 100%; text-align: center; }
}
