:root {
    --yt-white: #ffffff;
    --yt-off-white: #f8f9fa;
    --yt-border: #efefef;
    --yt-text: #0f0f0f;
    --yt-text-secondary: #606060;
    --yt-blue: #065fd4;
    --yt-blue-hover: #def1ff;
    --yt-shadow: 0 4px 20px rgba(0,0,0,0.05);
    --premium-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

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

body {
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    background-color: var(--yt-white);
    color: var(--yt-text);
    overflow-x: hidden;
}

/* Header Glassmorphism */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid var(--yt-border);
}

.search-container {
    flex: 0 1 720px;
    display: flex;
    gap: 12px;
}

.search-bar {
    flex: 1;
    display: flex;
    border: 1px solid #ccc;
    border-radius: 40px;
    overflow: hidden;
    background: #fdfdfd;
    transition: all 0.2s;
}

.search-bar:focus-within {
    border-color: var(--yt-blue);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 8px 16px;
    outline: none;
    font-size: 15px;
}

.search-bar button {
    background: #f8f8f8;
    border: none;
    border-left: 1px solid #ccc;
    padding: 0 20px;
    cursor: pointer;
}

/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: white;
    padding: 12px;
    z-index: 900;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--yt-text);
    font-size: 14px;
    transition: background 0.2s;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: #f0f0f0;
}

.nav-item.active {
    background: #f2f2f2;
    font-weight: 500;
}

.nav-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Video Grid Layout */
main {
    margin-top: 64px;
    margin-left: 240px;
    padding: 24px;
}

.topic-pills {
    display: flex;
    gap: 12px;
    padding: 12px 0 24px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pill {
    padding: 8px 14px;
    background: #f0f0f0;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pill:hover { background: #e5e5e5; }
.pill.active { background: #0f0f0f; color: white; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px 16px;
}

/* Premium Video Card */
.video-card {
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.thumbnail-container {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #eee;
    aspect-ratio: 16/9;
}

.thumbnail-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: scale 0.5s;
}

.video-card:hover .thumbnail-container img {
    scale: 1.05;
}

.video-info {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.channel-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* ✅ 표준 속성 추가 */
    overflow: hidden;
}

.video-meta {
    font-size: 14px;
    color: var(--yt-text-secondary);
}

/* Selection & Action Bar */
.selection-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(120%);
    background: #0f0f0f;
    color: white;
    padding: 12px 28px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 32px;
    z-index: 2000;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.selection-bar.active {
    transform: translateX(-50%) translateY(0);
}

.card-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    accent-color: #3b82f6;
    z-index: 20;
    opacity: 0;
    cursor: pointer;
}

.video-card:hover .card-checkbox, .card-checkbox:checked {
    opacity: 1;
}

/* Modal Styling */
.yt-modal {
    background: white;
    border-radius: 20px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 64px rgba(0,0,0,0.2);
    animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--yt-text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: var(--yt-blue);
    outline: none;
}

/* Custom Checkbox Grid */
.attribute-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.attr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.attr-item:hover { background: #f0f2f5; }
