* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: #1a1a2e;
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    margin-bottom: 10px;
}

header nav {
    display: flex;
    gap: 20px;
}

header nav a {
    color: white;
    text-decoration: none;
}

header nav a:hover {
    text-decoration: underline;
}

/* Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.video-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.video-card a {
    text-decoration: none;
    color: inherit;
}

.video-thumbnail {
    position: relative;
    background: #000;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail {
    color: #999;
    font-size: 14px;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.video-card:hover .play-button {
    opacity: 1;
}

.video-card h3 {
    padding: 15px 15px 5px;
    font-size: 16px;
}

.video-meta {
    padding: 0 15px 15px;
    font-size: 12px;
    color: #666;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0;
}

.pagination a {
    padding: 8px 12px;
    background: white;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.pagination a.active {
    background: #1a1a2e;
    color: white;
    border-color: #1a1a2e;
}

/* Video Page */
.video-page {
    display: flex;
    gap: 30px;
    margin: 30px 0;
}

.video-content {
    flex: 2;
}

.video-sidebar {
    flex: 1;
}

.video-player-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.ad-content {
    text-align: center;
    color: white;
}

.skip-ad-btn {
    margin-top: 20px;
    padding: 10px 20px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.skip-ad-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.video-info {
    background: white;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
}

.video-stats {
    color: #666;
    font-size: 14px;
    margin: 10px 0;
}

.video-description {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ad-below-video {
    background: white;
    padding: 20px;
    margin-top: 20px;
    border-radius: 8px;
    text-align: center;
}

.ad-sidebar-banner {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

/* Related Videos */
.related-videos h3 {
    margin-bottom: 15px;
}

.related-video {
    margin-bottom: 15px;
}

.related-video a {
    display: flex;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.related-thumb {
    width: 80px;
    height: 60px;
    background: #000;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-thumb {
    font-size: 24px;
}

.related-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.related-info p {
    font-size: 12px;
    color: #666;
}

/* Admin Panel */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    background: #1a1a2e;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header nav {
    display: flex;
    gap: 20px;
}

.admin-header nav a {
    color: white;
    text-decoration: none;
}

.admin-content {
    padding: 30px 20px;
}

.admin-table {
    width: 100%;
    background: white;
    border-collapse: collapse;
    margin-top: 20px;
}

.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.btn-edit,
.btn-delete {
    padding: 5px 10px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    margin: 0 2px;
}

.btn-edit {
    background: #4CAF50;
    color: white;
}

.btn-delete {
    background: #f44336;
    color: white;
}

/* Forms */
.upload-form,
.login-container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background: #1a1a2e;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background: #16213e;
}

.error {
    background: #f44336;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.success {
    background: #4CAF50;
    color: white;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .video-page {
        flex-direction: column;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
    
    .admin-header {
        flex-direction: column;
        gap: 10px;
    }
}

footer {
    background: #1a1a2e;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}