/**
 * Filaflow 프론트엔드 공통 스타일시트
 * Bootstrap 5.3 기반
 * 
 * @created 2026-01-19
 */

/* ========================================
   CSS Variables
======================================== */
:root {
    --primary: #1e293b;
    --primary-accent: #6366f1;
    --primary-light: #eef2ff;
    --secondary: #64748b;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --color-primary: #1e293b;
    --color-accent: #6366f1;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ========================================
   Base Styles
======================================== */
* {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

body {
    background-color: var(--gray-50);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--gray-900);
}

/* ========================================
   Admin Preview Badge (플로팅)
======================================== */
.admin-preview-badge {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
}

.preview-badge-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: #1e293b;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.2s;
}

.preview-badge-btn:hover {
    background: #334155;
    transform: translateY(-2px);
}

.preview-badge-btn i {
    color: #f59e0b;
    font-size: 1rem;
}

.preview-badge-dot {
    width: 8px;
    height: 8px;
    background: #f59e0b;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 확장된 패널 */
.preview-badge-panel {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: 1rem;
    display: none;
}

.preview-badge-panel.show {
    display: block;
    animation: slideUp 0.2s ease;
}

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

.preview-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 0.75rem;
}

.preview-panel-header i {
    color: #f59e0b;
}

.preview-panel-title {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.875rem;
}

.preview-panel-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
}

.preview-panel-close:hover {
    color: #64748b;
}

.preview-panel-message {
    font-size: 0.8125rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.preview-panel-link {
    display: block;
    text-align: center;
    padding: 0.625rem 1rem;
    background: #1e293b;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: background 0.2s;
}

.preview-panel-link:hover {
    background: #334155;
    color: #fff;
}

/* ========================================
   Header
======================================== */
.site-header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-200);
    transition: all 0.3s ease;
}

.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    text-decoration: none;
    transition: all 0.2s;
}

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

.header-logos {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-image {
    max-height: 40px;
    width: auto;
}

.footer-logos {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-logo-image {
    max-height: 32px;
    width: auto;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-accent);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.25rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link-custom {
    padding: 0.5rem 1rem;
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link-custom:hover {
    color: var(--gray-900);
    background: var(--gray-100);
}

/* ========================================
   Hero Section
======================================== */
.hero-section {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    background-size: cover;
    background-position: center;
    padding: 6rem 0 3rem;
    margin-top: 63px;
    position: relative;
    overflow: hidden;
}

.hero-section.has-bg-image {
    background-blend-mode: overlay;
}

.hero-section.hero-visual-only {
    padding: 0;
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.hero-section.hero-visual-only.has-bg-image {
    background-blend-mode: normal;
    background: none;
}

.hero-section.hero-visual-only .hero-visual-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-section.hero-main {
    padding: 8rem 0 4rem;
}

.hero-title-sm {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.hero-subtitle-sm {
    font-size: 1rem;
    opacity: 0.85;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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='%23ffffff' fill-opacity='0.04'%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");
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255,255,255,0.2);
}

.hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.hero-stat {
    text-align: center;
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.hero-stat-label {
    font-size: 0.875rem;
    opacity: 0.7;
}

/* ========================================
   Main Content
======================================== */
.main-content {
    flex: 1;
    padding: 3rem 0;
    margin-top: 73px;
}

.main-content.with-hero {
    margin-top: 0;
}

/* ========================================
   Section Header
======================================== */
.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ========================================
   Cards
======================================== */
.card-modern {
    background: #fff;
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card-modern:hover {
    box-shadow: var(--shadow-lg);
}

.card-header-modern {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body-modern {
    padding: 1.5rem;
}

/* ========================================
   Category Tabs
======================================== */
.category-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.category-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 100px;
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.category-tab:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
    background: var(--primary-light);
}

.category-tab.active {
    background: var(--primary-accent);
    border-color: var(--primary-accent);
    color: #fff;
}

.category-count {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    background: var(--gray-100);
    border-radius: 100px;
    color: var(--gray-500);
}

.category-tab.active .category-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ========================================
   Work Grid
======================================== */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.work-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.work-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.work-thumbnail {
    aspect-ratio: 4/3;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.work-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.work-thumbnail i {
    font-size: 3rem;
    color: var(--gray-300);
}

.work-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.work-card:hover .work-overlay {
    opacity: 1;
}

.work-view-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: #fff;
    color: var(--gray-900);
    padding: 0.5rem 1.25rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.work-view-btn i {
    font-size: 1rem;
    line-height: 1;
}

.work-card:hover .work-view-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.work-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.work-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    background: #eef2ff;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
    margin-bottom: 0.625rem;
    width: fit-content;
}

.work-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.375rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-author {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ========================================
   Forms
======================================== */
.form-label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-control, .form-select {
    padding: 0.875rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
    background: #fff;
}

.form-control:focus, .form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.form-text {
    color: var(--gray-500);
    font-size: 0.8rem;
    margin-top: 0.375rem;
}

/* ========================================
   Buttons
======================================== */
.btn {
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border-radius: 12px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: #4f46e5;
    border-color: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.btn-accent {
    background: var(--primary-accent);
    border: none;
    color: #fff;
}

.btn-accent:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
    color: #fff;
}

.btn-outline-dark {
    color: var(--gray-900);
    border: 2px solid var(--gray-300);
    background: transparent;
}

.btn-outline-dark:hover {
    background: var(--gray-900);
    border-color: var(--gray-900);
    color: #fff;
}

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

.btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    transform: translateY(-2px);
}

.btn-light {
    background: var(--gray-100);
    border-color: var(--gray-100);
    color: var(--gray-700);
}

.btn-light:hover {
    background: var(--gray-200);
    border-color: var(--gray-200);
}

/* ========================================
   Privacy Box
======================================== */
.privacy-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1.25rem;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.7;
}

.privacy-box::-webkit-scrollbar {
    width: 6px;
}

.privacy-box::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 3px;
}

.privacy-box::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

/* ========================================
   Checkbox
======================================== */
.form-check-input {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 6px;
}

.form-check-input:checked {
    background-color: #6366f1;
    border-color: #6366f1;
}

.form-check-label {
    padding-left: 0.5rem;
    font-weight: 500;
}

/* ========================================
   Alerts
======================================== */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-light);
    color: #065f46;
}

.alert-danger {
    background: var(--danger-light);
    color: #991b1b;
}

/* ========================================
   Empty State
======================================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    width: 100px;
    height: 100px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.empty-icon i {
    font-size: 2.5rem;
    color: var(--gray-400);
}

.empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.empty-desc {
    color: var(--gray-500);
}

/* ========================================
   Footer
======================================== */
.site-footer {
    background: #f1f5f9;
    color: var(--gray-600);
    padding: 2.5rem 0;
    border-top: 1px solid var(--gray-200);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--gray-800);
    font-weight: 600;
    font-size: 1rem;
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .hero-section.hero-visual-only {
        height: auto;
        min-height: 150px;
    }
    
    .hero-section.hero-visual-only .hero-visual-img {
        height: auto;
        object-fit: contain;
    }
}

@media (max-width: 767.98px) {
    .site-header {
        padding: 0.75rem 0;
    }
    
    .hero-section {
        padding: 6rem 0 3rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
    }
    
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.75rem;
        margin-bottom: 1.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .category-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .work-grid {
        grid-template-columns: 1fr;
    }
}
