:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f3f4f6;
    --white: #ffffff;
    --gray: #6b7280;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F7C820;
    min-height: 100vh;
}

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

/* Header */
.header {
    background: var(--white);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.logo h1 {
    color: var(--primary);
    font-size: 28px;
}

.logo p {
    color: var(--dark);
    font-size: 14px;
    margin-top: 5px;
}

.admin-link, .playlist-link {
    background: var(--primary);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.3s;
    display: inline-block;
}

.admin-link:hover, .playlist-link:hover {
    transform: translateY(-2px);
    background: var(--primary-dark);
}

/* Barra de Busca */
.search-bar {
    background: var(--light);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.search-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
}

.search-btn {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

/* Filtros de Categoria */
.category-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.category-btn {
    background: var(--light);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--primary);
    color: white;
}

/* Grid de Vídeos */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

.video-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-thumbnail.default {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.play-icon {
    font-size: 60px;
    color: var(--white);
    opacity: 0.9;
    transition: transform 0.3s;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.video-card:hover .play-icon {
    transform: scale(1.1);
}

.video-category {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
}

.video-info {
    padding: 20px;
}

.video-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 10px;
}

.video-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px 0;
    border-top: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
}

.views, .rating {
    font-size: 14px;
    color: var(--gray);
}

.views span, .rating span {
    font-weight: bold;
    color: var(--primary);
}

.watch-btn {
    display: inline-block;
    width: 100%;
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s;
}

.watch-btn:hover {
    background: var(--primary-dark);
}

/* Player Page */
.player-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.video-wrapper {
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

video {
    width: 100%;
    height: auto;
}

.video-details {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.video-category-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 10px;
}

/* Sistema de Comentários */
.comments-section {
    background: var(--white);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.comment-form {
    margin-bottom: 20px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
}

.comment-form button {
    background: var(--primary);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 10px;
}

.comment {
    border-bottom: 1px solid var(--light);
    padding: 15px 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--gray);
    font-size: 12px;
}

.comment-author {
    font-weight: bold;
    color: var(--primary);
}

.comment-text {
    line-height: 1.5;
}

/* Rating Buttons */
.rating-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.rating-good, .rating-bad {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.2s;
}

.rating-good {
    background: var(--secondary);
    color: white;
}

.rating-bad {
    background: var(--danger);
    color: white;
}

/* Admin Form */
.form-container {
    background: var(--white);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--dark);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--light);
    border-radius: 8px;
    font-size: 16px;
}

.thumbnail-preview {
    margin-top: 10px;
    max-width: 200px;
}

.thumbnail-preview img {
    width: 100%;
    border-radius: 8px;
}

/* Playlists */
.playlist-container {
    background: var(--white);
    border-radius: 15px;
    padding: 20px;
}

.playlist-card {
    background: var(--light);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.playlist-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
}

.playlist-videos {
    margin-top: 10px;
    padding-left: 20px;
}

.playlist-video-item {
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFF5EE;
    padding: 20px;
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    color: var(--primary);
    margin-bottom: 30px;
    text-align: center;
}

/* Tabs */
.tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    background: var(--light);
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s;
}

.tab-btn:hover {
    transform: translateY(-2px);
    background: #e5e7eb;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

/* Admin Table */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

.admin-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: bold;
}

.admin-table tr:hover {
    background: var(--light);
}

.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-edit, .btn-delete, .btn-watch, .btn-cancel {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
}

.btn-edit {
    background: var(--warning);
    color: white;
}

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

.btn-watch {
    background: var(--primary);
    color: white;
}

.btn-cancel {
    background: var(--gray);
    color: white;
}

.btn-submit {
    background: var(--secondary);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #059669;
}

.logout-btn {
    background: var(--danger);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s;
    display: inline-block;
}

.logout-btn:hover {
    background: #dc2626;
}

/* Rating Bar */
.rating-bar {
    width: 100px;
    height: 20px;
    background: var(--light);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
}

.rating-percent {
    height: 100%;
    background: var(--secondary);
    transition: width 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
}

/* Stats Box */
.stats-box {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.stat-label {
    color: var(--gray);
    font-size: 14px;
}

/* Password Form */
.password-form {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

/* Info Box */
.info-box {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .header-top {
        flex-direction: column;
        text-align: center;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th, .admin-table td {
        padding: 8px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tab-buttons {
        justify-content: center;
    }
    
    .login-box {
        padding: 20px;
        margin: 20px;
    }
}

/* Alertas */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease-in;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

/* Scrollbar Personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Back Link */
.back-link {
    display: inline-block;
    margin-top: 20px;
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

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