:root {
    --primary-color: #4a90e2;
    --secondary-color: #6c757d;
    --background-bg: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #212529;
    --text-muted: #6c757d;
    --accent-color: #7b2cbf;
    /* Deep purple for a premium feel */
}

body {
    background-color: var(--background-bg);
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding-top: 70px;
}

/* Layout */
#login-section,
#video-section {
    display: none;
}

/* Card Enhancements */
.card {
    border: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
}

.video-card {
    transition: transform 0.2s;
}

.video-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.video-thumb {
    cursor: pointer;
    height: 180px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Interactive Elements on Video Cards */
.close-video-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 22px;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    transition: background 0.2s;
}

.close-video-btn:hover {
    background: red;
}

.add-video-btn {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    transition: background 0.2s;
}

.add-video-btn:hover {
    background: #0d6efd;
}

.group-count-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #0dcaf0;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
    border: 2px solid white;
}

/* Video Player Styles */
.video-container {
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

#videoDisplay {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.video-info {
    background: var(--card-bg);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

/* Edit Group Video List */
.edit-group-video-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.edit-group-video-item:last-child {
    border-bottom: none;
}

.edit-group-video-thumb {
    width: 80px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
}

.edit-group-video-info {
    flex-grow: 1;
    min-width: 0;
}

.edit-group-video-title {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.btn-action {
    margin-right: 10px;
}

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

.btn-primary:hover {
    background-color: #357abd;
    border-color: #357abd;
    transform: translateY(-1px);
}

/* Comments Section */
.comment-section {
    margin-top: 30px;
}

.comment-card {
    border-radius: 10px;
    background: #fff;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 12px;
    transition: background-color 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.comment-card:hover {
    background-color: #fcfcfc;
}

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

.comment-user {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #444;
}

/* Modal Polish */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid #eee;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #eee;
    padding: 1rem 1.5rem;
}

/* Edit Section */
.edit-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

/* Video Page Player – Force stacking context below modals (Firefox fix) */
#pageVideoPlayerWrapper {
    position: relative;
    z-index: 1;
    transform: translateZ(0);
    /* Force new stacking context for Firefox */
    overflow: hidden;
}

#pageVideoPlayerWrapper iframe,
#pageVideoPlayerWrapper video {
    z-index: 1;
}

/* Ensure Bootstrap modals always sit above embedded media */
.modal-backdrop {
    z-index: 1050 !important;
}

.modal {
    z-index: 1055 !important;
}