* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f0f2f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #1a1a1a;
    margin-bottom: 30px;
}

.api-key-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.api-key-info {
    margin-bottom: 15px;
    color: #666;
}

.api-key-info a {
    color: #1a73e8;
    text-decoration: none;
}

.api-key-info a:hover {
    text-decoration: underline;
}

.api-key-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.api-key-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.search-filters {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.filter-group input,
.filter-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #1a73e8;
}

button {
    background: #ff0000;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s;
}

button:hover {
    background: #cc0000;
}

button:disabled {
    background: #999;
    cursor: not-allowed;
}

button.secondary {
    background: #666;
}

button.secondary:hover {
    background: #555;
}

.error-message {
    background: #fee;
    color: #c00;
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    border-left: 4px solid #c00;
}

.video-results h2 {
    margin-bottom: 20px;
}

.result-count {
    color: #666;
    font-size: 18px;
    font-weight: normal;
}

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

.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 비율 */
    overflow: hidden;
    background: #000;
}

.thumbnail-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    padding: 15px;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.video-description {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.video-stats {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-icon {
    font-size: 16px;
}

.upload-date {
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.watch-link {
    display: inline-block;
    color: #ff0000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.watch-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .api-key-input {
        flex-direction: column;
    }
    
    .api-key-input input {
        width: 100%;
    }
}