/* ============================================
   SMC x ReBeauty Collaboration Timeline
   Business-grade design system
   ============================================ */

/* --- Design Tokens --- */
:root {
    --smc-primary: #b91c1c;
    --smc-dark: #7f1d1d;
    --smc-surface: #fafaf9;
    --smc-bg: #0c0a09;
    --smc-accent: #dc2626;

    --rb-primary: #6d28d9;
    --rb-dark: #4c1d95;
    --rb-surface: #faf5ff;
    --rb-bg: linear-gradient(175deg, #f5f3ff 0%, #ede9fe 40%, #e9e5ff 100%);
    --rb-accent: #7c3aed;

    --text-primary: #1c1917;
    --text-secondary: #57534e;
    --text-muted: #a8a29e;
    --border: #e7e5e4;
    --border-light: #f5f5f4;

    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Base Typography --- */
body {
    font-family: 'Inter', 'Noto Sans JP', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: var(--text-primary);
    letter-spacing: -0.011em;
    line-height: 1.6;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

/* --- Navbar --- */
.app-navbar {
    background: #18181b;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
}

.app-navbar .brand-smc {
    color: #ef4444;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.app-navbar .brand-divider {
    color: #52525b;
    font-weight: 300;
    margin: 0 2px;
}

.app-navbar .brand-rb {
    color: #a78bfa;
    font-weight: 600;
}

.app-navbar .nav-user {
    color: #a1a1aa;
    font-size: 13px;
    font-weight: 400;
}

.app-navbar .nav-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 4px;
}

.app-navbar .nav-badge-smc {
    background: rgba(239,68,68,0.15);
    color: #fca5a5;
    border: 1px solid rgba(239,68,68,0.2);
}

.app-navbar .nav-badge-rb {
    background: rgba(167,139,250,0.15);
    color: #c4b5fd;
    border: 1px solid rgba(167,139,250,0.2);
}

.app-navbar .nav-btn {
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 7px;
    transition: all var(--transition);
    letter-spacing: 0;
}

.app-navbar .nav-btn-primary {
    background: rgba(255,255,255,0.08);
    color: #e4e4e7;
    border: 1px solid rgba(255,255,255,0.08);
}

.app-navbar .nav-btn-primary:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.14);
}

.app-navbar .nav-btn-ghost {
    color: #71717a;
    background: transparent;
}

.app-navbar .nav-btn-ghost:hover {
    color: #a1a1aa;
    background: rgba(255,255,255,0.05);
}

/* --- Panel Layout --- */
.timeline-container {
    width: 100%;
}

.panel {
    flex: 1;
    min-width: 0;
    position: relative;
}

/* --- Panel Collapse --- */
.panel.collapsed {
    flex: 0 0 44px !important;
    min-width: 44px;
    max-width: 44px;
    cursor: pointer;
}

.panel.collapsed .panel-header,
.panel.collapsed .panel-body {
    display: none;
}

.panel.collapsed .collapsed-label {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 3px;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 3px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    user-select: none;
    transition: opacity var(--transition);
}

.panel-smc.collapsed .collapsed-label {
    background: var(--smc-bg);
    color: var(--smc-accent);
}

.panel-rebeauty.collapsed .collapsed-label {
    background: linear-gradient(180deg, var(--rb-dark) 0%, #3b0764 100%);
    color: rgba(255,255,255,0.85);
}

.panel.expanded {
    flex: 1;
}

/* --- SMC Panel --- */
.panel-smc {
    background: var(--smc-surface);
    font-family: 'Noto Sans JP', 'Inter', sans-serif;
}

.panel-smc .panel-header {
    background: var(--smc-bg);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.panel-smc .panel-title {
    color: #fafafa;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.08em;
}

.panel-smc .collapse-btn {
    color: rgba(255,255,255,0.35);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.08);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 11px;
}

.panel-smc .collapse-btn:hover {
    color: rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.06);
}

/* SMC Timeline Line */
.timeline-line-smc {
    position: relative;
    padding-left: 22px;
}

.timeline-line-smc::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: linear-gradient(180deg, var(--smc-accent) 0%, rgba(185,28,28,0.1) 100%);
}

/* SMC Card */
.card-smc {
    background: #fff;
    border: 1px solid var(--border);
    border-left: 3px solid var(--smc-accent);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    position: relative;
}

.card-smc::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 20px;
    width: 9px;
    height: 9px;
    background: var(--smc-accent);
    border-radius: 50%;
    border: 2px solid var(--smc-surface);
    box-shadow: 0 0 0 2px rgba(185,28,28,0.15);
}

.card-smc:hover {
    box-shadow: var(--shadow-md);
    border-color: #d6d3d1;
}

.card-smc .card-date {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--smc-primary);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.card-smc .card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 4px;
    line-height: 1.4;
}

.card-smc .card-content {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.card-smc .btn-edit {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-weight: 500;
}

.card-smc .btn-edit:hover {
    color: var(--smc-primary);
    border-color: rgba(185,28,28,0.3);
    background: rgba(185,28,28,0.04);
}

.card-smc .btn-delete {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-weight: 500;
}

.card-smc .btn-delete:hover {
    color: #dc2626;
    border-color: rgba(220,38,38,0.3);
    background: rgba(220,38,38,0.04);
}

/* --- ReBeauty Panel --- */
.panel-rebeauty {
    background: var(--rb-bg);
    font-family: 'Noto Sans KR', 'Inter', sans-serif;
}

.panel-rebeauty .panel-header {
    background: linear-gradient(90deg, var(--rb-dark) 0%, #5b21b6 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.panel-rebeauty .panel-title {
    color: #fafafa;
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.04em;
}

.panel-rebeauty .collapse-btn {
    color: rgba(255,255,255,0.4);
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 11px;
}

.panel-rebeauty .collapse-btn:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
}

/* ReBeauty Timeline Line */
.timeline-line-rebeauty {
    position: relative;
    padding-left: 22px;
}

.timeline-line-rebeauty::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 1.5px;
    background: linear-gradient(180deg, var(--rb-accent) 0%, rgba(124,58,237,0.08) 100%);
}

/* ReBeauty Card */
.card-rebeauty {
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(139,92,246,0.04);
    transition: all var(--transition);
    position: relative;
}

.card-rebeauty::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 20px;
    width: 9px;
    height: 9px;
    background: var(--rb-accent);
    border-radius: 50%;
    border: 2px solid #ede9fe;
    box-shadow: 0 0 0 2px rgba(124,58,237,0.12);
}

.card-rebeauty:hover {
    box-shadow: var(--shadow-md), 0 0 0 1px rgba(139,92,246,0.08);
    background: rgba(255,255,255,0.8);
}

.card-rebeauty .card-date {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--rb-primary);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.card-rebeauty .card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e1b4b;
    margin-top: 4px;
    line-height: 1.4;
}

.card-rebeauty .card-content {
    font-size: 13.5px;
    color: #4c1d95;
    line-height: 1.7;
    opacity: 0.75;
}

.card-rebeauty .btn-edit {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(124,58,237,0.15);
    font-weight: 500;
}

.card-rebeauty .btn-edit:hover {
    color: var(--rb-primary);
    border-color: rgba(124,58,237,0.3);
    background: rgba(124,58,237,0.05);
}

.card-rebeauty .btn-delete {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(124,58,237,0.1);
    font-weight: 500;
}

.card-rebeauty .btn-delete:hover {
    color: #dc2626;
    border-color: rgba(220,38,38,0.25);
    background: rgba(220,38,38,0.04);
}

/* --- Card Shared --- */
.card-meta {
    font-family: 'Inter', sans-serif;
}

.card-actions .btn-edit,
.card-actions .btn-delete {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    letter-spacing: 0;
}

/* --- Card Image --- */
.card-image img {
    max-width: 100%;
    border-radius: var(--radius);
}

/* --- Scrollbar --- */
.panel-smc .panel-body::-webkit-scrollbar,
.panel-rebeauty .panel-body::-webkit-scrollbar {
    width: 5px;
}

.panel-smc .panel-body::-webkit-scrollbar-track,
.panel-rebeauty .panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-smc .panel-body::-webkit-scrollbar-thumb {
    background: rgba(185,28,28,0.12);
    border-radius: 10px;
}

.panel-smc .panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(185,28,28,0.25);
}

.panel-rebeauty .panel-body::-webkit-scrollbar-thumb {
    background: rgba(124,58,237,0.12);
    border-radius: 10px;
}

.panel-rebeauty .panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(124,58,237,0.25);
}

/* --- Panel Divider --- */
.panel-divider {
    background: #27272a !important;
}

/* --- Dropzone --- */
.dropzone {
    position: relative;
    border: 1.5px dashed #d6d3d1;
    border-radius: var(--radius-lg);
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: #fafaf9;
}

.dropzone:hover {
    border-color: var(--rb-accent);
    background: #faf5ff;
}

.dropzone-active {
    border-color: var(--rb-accent) !important;
    background: #f5f3ff !important;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.08);
}

.dropzone-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.dropzone-content {
    pointer-events: none;
}

.dropzone-icon {
    width: 36px;
    height: 36px;
    margin: 0 auto 10px;
    color: #a8a29e;
    transition: color var(--transition);
}

.dropzone:hover .dropzone-icon {
    color: var(--rb-accent);
}

.dropzone-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.dropzone-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* --- File Preview --- */
.file-preview-list {
    margin-top: 8px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
    transition: border-color var(--transition);
}

.file-preview-item:hover {
    border-color: #d6d3d1;
}

.file-preview-item.file-preview-error {
    border-color: #fca5a5;
    background: #fef2f2;
}

.file-preview-thumb {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f4;
    border-radius: 8px;
    overflow: hidden;
}

.file-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-ext {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.file-preview-name {
    font-size: 12.5px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.file-preview-size {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
}

.file-preview-oversize {
    color: #dc2626;
    font-weight: 600;
}

.file-preview-remove {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    border: none;
    background: #f5f5f4;
    color: var(--text-muted);
    border-radius: 50%;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.file-preview-remove:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* --- Image Gallery --- */
.card-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 5px;
    border-radius: var(--radius);
    overflow: hidden;
}

.gallery-item {
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.06);
}

/* Single image - full width */
.card-gallery:has(.gallery-item:only-child) {
    grid-template-columns: 1fr;
}

.card-gallery .gallery-item:only-child {
    aspect-ratio: auto;
    max-height: 280px;
}

/* --- YouTube Embed --- */
.youtube-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* --- Video Player --- */
.card-video video {
    max-width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* --- File Attachments --- */
.card-attachments {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.attachment-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 12.5px;
    transition: all var(--transition);
}

.attachment-link:hover {
    background: rgba(0,0,0,0.04);
    border-color: var(--border);
}

.attachment-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 2px 6px;
    background: var(--text-secondary);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.attachment-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 400;
}

.attachment-size {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- Edit Form Existing Files --- */
.existing-file-item {
    border: 1px solid var(--border);
    background: #fff;
    transition: border-color var(--transition);
}

.existing-file-item:hover {
    border-color: #d6d3d1;
}

/* --- Lightbox --- */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: lightbox-in 0.15s ease-out;
}

@keyframes lightbox-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 6px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    font-size: 22px;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 10000;
    backdrop-filter: blur(8px);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* --- Flash Messages --- */
.flash-msg {
    backdrop-filter: blur(12px);
    font-weight: 500;
    letter-spacing: -0.01em;
    border-radius: var(--radius);
}

/* --- Form Pages --- */
.form-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.form-card h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0;
}

.form-input {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    transition: all var(--transition);
    background: #fff;
}

.form-input:focus {
    outline: none;
    border-color: var(--rb-accent);
    box-shadow: 0 0 0 3px rgba(124,58,237,0.08);
}

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

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-submit {
    background: var(--text-primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 28px;
    border-radius: var(--radius);
    transition: all var(--transition);
    border: none;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow-sm);
}

.btn-submit:hover {
    background: #292524;
    box-shadow: var(--shadow);
}

.btn-cancel {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 400;
    transition: color var(--transition);
}

.btn-cancel:hover {
    color: var(--text-secondary);
}

/* --- Login Page --- */
.login-card {
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2);
}

.login-input {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius);
    color: #fafafa;
    font-size: 14px;
    transition: all var(--transition);
}

.login-input:focus {
    outline: none;
    border-color: rgba(167,139,250,0.5);
    box-shadow: 0 0 0 3px rgba(167,139,250,0.1);
    background: rgba(255,255,255,0.06);
}

.login-input::placeholder {
    color: #52525b;
}

.login-btn {
    background: #fafafa;
    color: #18181b;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 0;
    border-radius: var(--radius);
    border: none;
    transition: all var(--transition);
    letter-spacing: -0.01em;
}

.login-btn:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(255,255,255,0.1);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .timeline-container {
        flex-direction: row;
        height: calc(100vh - 52px);
    }

    .panel {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: none !important;
    }

    .panel.collapsed {
        flex: 0 0 36px !important;
        min-width: 36px !important;
        max-width: 36px !important;
    }

    .panel.collapsed .collapsed-label {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .panel:not(.collapsed) {
        flex: 1 !important;
    }

    .panel-divider {
        width: 1px !important;
        height: auto !important;
    }

    .collapse-btn {
        display: none;
    }

    .card-smc,
    .card-rebeauty {
        padding: 12px 14px;
    }

    .card-gallery {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    }
}

@media (max-width: 480px) {
    .app-navbar .nav-user {
        display: none;
    }
}
