body {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9; /* Light background */
    color: #333; /* Dark text */
    line-height: 1.6;

}

.comment-avatar-img {
    width: 40px;  /* Set a fixed width */
    height: 40px; /* Set a fixed height (same as width for a perfect circle) */
    border-radius: 50%; /* Makes the image circular */
    object-fit: cover; /* Ensures the image fills the area without distortion, cropping if needed */
    margin-right: 15px; /* Adds space between the avatar and the "Add a comment..." text */
    vertical-align: middle; /* Aligns the image nicely with the text */
    border: 1px solid #eee; /* Optional: adds a subtle light gray border */
    flex-shrink: 0; /* Prevents the image from shrinking on smaller screens/flexible layouts */
}


.channel-avatar {
     width: 30px;  /* Set a fixed width */
    height: 30px; /* Set a fixed height (same as width for a perfect circle) */
    border-radius: 50%; /* Makes the image circular */

}



.channel-link {
    font-size: 13px;
  text-decoration: underline;
  text-decoration-color: white;
  color: #1A73E8;
  font-weight: bold;

}


header {
    background-color: #ff0000; /* YouTube Red */
    color: white;
    padding: 15px 40px;
    display: flex;
    height: 65px;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 700;
    letter-spacing: -1px;
}

/* Added specific styles for the logo link on channel.php for better alignment */
.header .logo a {
    color: white; /* Ensure link color is white in header */
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.header .logo span {
    background-color: black;
    margin-left: -3px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1px;
    color: white;
    font-size: 24px;
}

.header .logo img {
    position: absolute;
    margin-top: -1px;
    left: 50%;
    margin-left: 6px;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.search-bar {
    display: flex;
    align-items: center;
}

.search-bar input {
    padding: 8px 12px;
    width: 350px;
    border: none;
    border-radius: 2px 0 0 2px;
    font-size: 14px;
    outline: none;
    box-shadow: 0 1px 6px rgba(32,33,36,0.28);
}

.search-bar button {
    padding: 8px 15px;
    background-color: #f8f8f8;
    border: none;
    border-radius: 0 2px 2px 0;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #e9e8e9;
}

.user-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.user-menu a, .user-menu span {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s;
    white-space: nowrap;
}

.user-menu a:hover {
    text-decoration: underline;
    color: #ddd;
}

/* New: User actions with icons */
.header .user-actions {
    display: flex;
    align-items: center;
    gap: 15px; /* Space between icons/links */
}

.header .user-actions .icon-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: white; /* Icons in header should be white */
    transition: color 0.3s ease;
    border-radius: 50%; /* Circular buttons */
    padding: 5px; /* Padding for click area */
}

.header .user-actions .icon-btn:hover {
    color: #f0f0f0; /* Lighter white on hover */
    background-color: rgba(255,255,255,0.1); /* Subtle background on hover */
}

.header .user-actions .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.5); /* Subtle border for avatar */
}


/* Style for the Shuffle Videos Button */
.shuffle-btn {
    padding: 8px 15px;
    margin-left: 10px; /* Space from other menu items */
    background-color: #4CAF50; /* Green for "shuffle" */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s;
    white-space: nowrap; /* Prevent text from wrapping */
}

.shuffle-btn:hover {
    background-color: #45a049; /* Darker green on hover */
}


.video-grid {
    display: grid;
    /* Desktop: 3 columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 20px 30px;
    max-width: 1280px;
    margin: 0 auto;
}

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

.video-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Remove default underline from the main link */
.video-card a {
    text-decoration: none; /* This ensures the main link has no underline */
    color: inherit; /* Inherit color from parent, or set your desired link color */
}


.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden; /* Ensure play button doesn't overflow rounded corners */
}

.video-thumbnail video,
.video-thumbnail img { /* Apply to both video and img for consistency */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

/* Play button overlay styles */
.play-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 0, 0, 0.8); /* Red with some transparency */
    border-radius: 50%; /* Make it a circle */
    width: 60px; /* Size of the button */
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white; /* Play icon color */
    font-size: 24px; /* Size of the play icon */
    cursor: pointer;
    z-index: 5; /* Ensure it's above the video */
    opacity: 1; /* Always visible */
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); /* Subtle shadow for depth */
}

/* Hover effect for the entire video card */
.video-card:hover .play-button-overlay {
    transform: translate(-50%, -50%) scale(1.1); /* Slightly grow on hover */
}


.video-info {
    padding: 10px;
}

.video-info h3 {
    font-size: 16px; /* Increased from 14px */
    margin: 0 0 5px;
    color: #030303;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: 0.5px; /* Added small spacing between letters */

    /* Explicitly add white underline to the H3 */
    text-decoration: underline;
    text-decoration-color: white;
}

.video-info p {
    font-size: 12px;
    margin: 2px 0;
    color: #606060;
}

/* Also remove underline from the 'Uploaded by:' link within the info, if desired */
.video-info p a {
    text-decoration: none;
    color: #065fd4; /* Keep the blue color for this link */
}

.video-info p a:hover {
    text-decoration: underline; /* Re-add underline on hover if desired */
}


form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input, textarea, button {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

button {
    background-color: #ff0000;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #cc0000;
}

.comment-form textarea {
    width: calc(100% - 22px);
    min-height: 80px;
    resize: vertical;
}

.comments-section {
    margin-top: 20px;
}

.comments-section h3 {
    color: #030303;
    margin-bottom: 15px;
}

.comment {
    background: #f9f9f9;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 4px;
    font-size: 14px;
    border: 1px solid #eee;
}

/* Reply button styling */
.reply-btn {
    padding: 5px 10px;
    background-color: #065fd4; /* Blue color for reply */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 5px; /* Space from comment text */
    transition: background-color 0.2s;
}

.reply-btn:hover {
    background-color: #054ea4;
}

/* Styling for nested replies (comment-reply class) */
.comment.comment-reply {
    background-color: #e8e8e8; /* Lighter grey for replies */
    border-left: 4px solid #888; /* Thicker, darker grey line on the left */
    padding-left: 15px; /* Adjust padding to make space for the border */
    margin-top: 8px; /* Slightly larger vertical gap to distinguish from parent */
    margin-bottom: 8px; /* Ensure replies group visually */
    border-radius: 0 4px 4px 0; /* Only round right corners for a stacked look */
}

/* Styles for the "View replies" toggle button */
.toggle-replies-container {
    margin-top: 5px;
    text-align: left; /* Align button to the left */
}

.view-replies-btn {
    background: none;
    border: none;
    color: #065fd4; /* Blue like a link */
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    margin: 0;
    transition: color 0.2s;
    display: inline-flex; /* Align text and icon */
    align-items: center;
    gap: 5px; /* Space between text and icon */
}

.view-replies-btn:hover {
    color: #054ea4;
    text-decoration: underline; /* Underline on hover */
}

.view-replies-btn .reply-count {
    font-weight: bold; /* Make the number bold */
}

.reply-arrow {
    transition: transform 0.2s ease-in-out; /* Smooth rotation for the arrow */
    transform-origin: center; /* Ensure rotation is centered */
}

.reply-arrow.fa-caret-up {
    transform: rotate(180deg); /* Rotate up when replies are shown */
}

/* Container for replies - initially hidden */
.replies-wrapper {
    /* No default styling, just controls display */
}


.comment p {
    margin: 0;
    color: #333;
}

.comment strong {
    color: #030303;
}

.comment small {
    color: #606060;
    font-size: 0.85em;
}

/* Styling for Like and Dislike buttons */
.like-btn, .dislike-btn {
    padding: 8px 12px; /* Slightly reduced padding */
    margin-right: 5px; /* Space between buttons */
    background-color: #f0f0f0; /* Neutral background */
    color: #606060; /* Grey text/icon */
    border: none;
    border-radius: 20px; /* More rounded pill shape */
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, transform 0.1s;
    display: inline-flex; /* Align icon and text */
    align-items: center;
    gap: 8px; /* Space between icon and count */
    font-size: 14px;
}

.like-btn:hover, .dislike-btn:hover {
    background-color: #e0e0e0; /* Darker grey on hover */
    transform: translateY(-1px); /* Slight lift on hover */
}

/* Active state for like button */
.like-btn.active {
    background-color: #2196F3; /* Blue when active */
    color: white;
}

/* Active state for dislike button */
.dislike-btn.active {
    background-color: #FF5722; /* Orange/Red when active */
    color: white;
}

/* Adjust colors for active icons if needed */
.like-btn.active i, .dislike-btn.active i {
    color: white;
}


/* Share Button Styling */
.share-btn {
    padding: 8px 15px;
    margin-left: 10px; /* Space from like/dislike buttons */
    background-color: #065fd4; /* A blue color for share */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.share-btn:hover {
    background-color: #054ea4;
}

/* Subscribe Button Styling (General) */
.subscribe-btn {
    padding: 8px 15px;
    margin-left: 10px; /* Space from other buttons */
    background-color: #cc0000; /* YouTube Red */
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.subscribe-btn:hover {
    background-color: #a00000; /* Darker red on hover */
}

.subscribe-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    color: #666;
}

/* Subscribed state for the subscribe button */
.subscribe-btn.subscribed {
    background-color: #606060; /* Grey when subscribed */
}

.subscribe-btn.subscribed:hover {
    background-color: #505050; /* Darker grey on hover */
}


/* Copy Feedback Message */
.copy-feedback-message {
    background-color: #4CAF50; /* Green background */
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    margin-left: 15px; /* Space from buttons */
    font-size: 12px;
    animation: fadeOut 3s forwards;
    opacity: 1;
    white-space: nowrap;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; display: none; }
}


.pagination {
    text-align: center;
    margin: 20px auto;
    padding: 10px;
}

.pagination a {
    color: #ff0000;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid #ff0000;
    border-radius: 4px;
    margin: 0 5px;
    transition: background-color 0.3s;
}

.pagination a:hover {
    background-color: #ffeeee;
}

.pagination a.current-page {
    background-color: #ff0000;
    color: white;
    font-weight: bold;
}

/* Profile Header Styling */
.profile-header {
    max-width: 1280px;
    margin: 20px auto;
    padding: 20px 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.profile-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #030303;
}

.profile-header p {
    font-size: 16px;
    color: #606060;
}


/* --- VIDEO PAGE SPECIFIC LAYOUT (LEFT VIDEO, RIGHT SIDEBAR) --- */
.video-page-layout {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: flex-start;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
}

.video-main-content {
    flex: 4;
    min-width: 0;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.video-sidebar {
    flex: 1;
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 250px;
}

.video-player-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 4px;
    margin-bottom: 15px;
}

.video-player-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Added for video unavailable placeholder on video.php */
.video-unavailable-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #e0e0e0; /* Light grey background */
    color: #757575; /* Darker grey text */
    display: flex; /* Use flex to center content */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 16px;
    border-radius: 4px; /* Match video border-radius */
    box-sizing: border-box; /* Include padding in dimensions */
    padding: 10px;
}

.video-unavailable-placeholder i {
    font-size: 40px; /* Larger icon */
    margin-bottom: 10px;
}


.video-details {
    margin-bottom: 20px;
}

.video-details h2 {
    text-decoration: none;
    font-size: 30px;
    margin-top: 0;
    margin-bottom: 10px;
    color: #168825;

}

.video-details p {
    font-size: 14px;
    color: #606060;
    margin-bottom: 5px;
}

.video-stats-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    flex-wrap: nowrap;
}

.video-stats-bar .views-count {
    font-size: 14px;
    color: #606060;
    margin: 0;
    flex-shrink: 0;
    display: inline-block;
}

.video-sidebar h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #030303;
}

.video-sidebar p {
    font-size: 13px;
    color: #606060;
    margin-bottom: 15px;
}

.video-sidebar .video-card {
    background-color: white;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-radius: 5px;
    overflow: hidden;
    padding: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    transition: none;
}

.video-sidebar .video-card:hover {
    transform: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.video-sidebar .video-card .video-thumbnail {
    width: 100px;
    height: auto;
    padding-top: 56.25%;
    flex-shrink: 0;
}

.video-sidebar .video-card .video-info {
    padding: 10px 0 10px 0;
    flex-grow: 1;
}

.video-sidebar .video-card .video-info h3 {
    font-size: 13px;
    margin: 0 0 3px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.4;
    max-height: 2.8em;
}

.video-sidebar .video-card .video-info p {
    font-size: 11px;
    margin: 0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
    font-size: 14px;
}

.admin-table thead th {
    background-color: #f0f0f0;
    font-weight: 600;
    color: #333;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover {
    background-color: #f5f5f5;
}

.admin-table .video-title-likes {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: normal;
}

.admin-table .video-likes-count {
    font-size: 13px;
    color: #606060;
    flex-shrink: 0;
}

.admin-table .delete-btn {
    padding: 6px 12px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.admin-table .delete-btn:hover {
    background-color: #c82333;
}

.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    text-align: center;
}

.modal-content p {
    font-size: 16px;
    margin-bottom: 20px;
    color: #333;
}

.modal-buttons button {
    background-color: #ff0000;
    color: white;
    border: none;
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.modal-buttons button:hover {
    background-color: #cc0000;
}

#confirm-no {
    background-color: #6c757d;
}
#confirm-no:hover {
    background-color: #5a6268;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}


/* NEW STYLES FOR THE CHANNEL.PHP PAGE (Individual Channel Profile) */
.channel-page-body .channel-main-content { /* Target main content on channel page */
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.channel-page-body .channel-header-section {
    display: flex;
    align-items: flex-start; /* Align content to the top */
    padding-bottom: 25px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 20px; /* Space between info and actions */
}

.channel-page-body .channel-profile-info {
    display: flex;
    align-items: flex-start;
    flex-grow: 1; /* Allows this section to take available space */
    gap: 20px;
    min-width: 0; /* Allow shrinking */
}

.channel-page-body .channel-large-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0; /* Prevent avatar from shrinking */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.channel-page-body .channel-text-info {
    flex-grow: 1;
    min-width: 0; /* Allow content to shrink */
}

.channel-page-body .channel-text-info h2 {
    font-size: 32px;
    margin-top: 0;
    margin-bottom: 8px;
    color: #030303;
    word-break: break-word; /* Break long channel names */
}

.channel-page-body .channel-owner-text {
    font-size: 15px;
    color: #606060;
    margin-bottom: 5px;
}

.channel-page-body .subscriber-count {
    font-size: 16px;
    color: #606060;
    margin-bottom: 15px;
}

.channel-page-body .channel-description {
    font-size: 15px;
    color: #303030;
    line-height: 1.6;
    white-space: pre-wrap; /* Preserve line breaks from DB */
}

.channel-page-body .channel-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Prevent actions from shrinking */
    margin-top: 10px; /* Space from profile info when wrapped */
}

.channel-page-body .channel-actions .subscribe-btn {
    padding: 12px 25px; /* Larger subscribe button on channel page */
    font-size: 16px;
    margin-left: 0; /* Override general margin-left for this specific button */
}

.channel-page-body .channel-owner-message {
    font-size: 15px;
    color: #606060;
    padding: 10px;
    border: 1px solid #eee;
    background-color: #f0f0f0;
    border-radius: 8px;
}

.channel-page-body .channel-videos-heading {
    font-size: 22px;
    color: #030303;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.channel-page-body .no-videos-message {
    text-align: center;
    color: #606060;
    padding: 20px;
    background-color: #f0f0f0;
    border-radius: 8px;
}

/* Video grid inside channel page */
.channel-page-body .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Auto-fit grid for videos on channel page */
    padding: 0; /* Reset padding from general .video-grid */
    margin: 0; /* Reset margin */
}

/* Original Channel grid (for displaying multiple channels, likely on a /channels.php page) */
.channels-header {
    max-width: 1280px;
    margin: 20px auto;
    padding: 20px 30px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.channels-header h2 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #030303;
}

.channels-header p {
    font-size: 16px;
    color: #606060;
}

.channel-grid { /* This is for a list of channels, not the individual channel page's video grid */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* Responsive grid */
    gap: 20px;
    padding: 20px 30px;
    max-width: 1280px;
    margin: 0 auto;
}

.channel-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Push subscribe button to bottom */
    padding: 15px;
    text-align: center;
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.channel-card a {
    text-decoration: none;
    color: inherit;
    display: block; /* Make the whole info block clickable */
}

.channel-card .channel-info {
    flex-grow: 1; /* Allow info section to take up available space */
    margin-bottom: 15px;
}

.channel-card h3 {
    font-size: 20px;
    margin: 0 0 8px;
    color: #030303;
    font-weight: bold;
}

.channel-card .channel-owner {
    font-size: 14px;
    color: #606060;
    margin-bottom: 5px;
}

.channel-card .channel-stats {
    font-size: 13px;
    color: #606060;
    margin-bottom: 10px;
}

.channel-card .channel-description {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin-top: 10px;
    word-wrap: break-word; /* Ensure long descriptions break */
}

.channel-card .subscribe-btn {
    width: 100%;
    padding: 10px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-left: 0; /* Reset margin for this context */
}

.channel-card .subscribe-btn:hover {
    background-color: #cc0000;
}

.channel-card .subscribe-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    color: #666;
}

/* Styling for the form container (already exists, but added here for clarity) */
.form-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 25px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-align: center;
}

.form-container h2 {
    font-size: 28px;
    margin-bottom: 25px;
    color: #030303;
}

.form-container form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-container label {
    text-align: left;
    font-weight: bold;
    color: #333;
    margin-bottom: -5px; /* Adjust spacing */
}

.form-container input[type="text"],
.form-container textarea,
.form-container select { /* Added select for consistency */
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box; /* Include padding in width */
}

.form-container textarea {
    resize: vertical;
}

.form-container button[type="submit"] {
    padding: 12px 20px;
    background-color: #ff0000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-top: 15px;
}

.form-container button[type="submit"]:hover {
    background-color: #cc0000;
}

.message {
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 15px;
    text-align: center;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* NEW STYLES FOR THE SIDEBAR ON INDEX.PHP */
.index-page-layout {
    display: flex;
    justify-content: center; /* Center the whole layout */
    max-width: 1500px; /* Max width for the entire page content */
    margin: 20px auto; /* Center the layout horizontally */
    padding: 0 20px; /* Padding on sides for smaller screens */
    gap: 20px; /* Space between sidebar and main content */
    align-items: flex-start; /* Align items to the top */
}

.sidebar-channels {
    flex: 0 0 100px; /* Fixed width sidebar, no shrinking or growing - increased width for better content fit */
    background-color: black; /* Changed to white background */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    align-self: stretch; /* Make it stretch to the height of the main content */
}

.sidebar-channels h3 {
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 15px;
    color: #030303;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.sidebar-channels ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-channels ul li {
    margin-bottom: 1px;
}

.sidebar-channels ul li a {
    text-decoration: none;
    color: #333;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-channels ul li a:hover {
    background-color: #f0f0f0;
    color: #ff0000; /* Red on hover */
}

.sidebar-channels ul li a i {
    color: #606060; /* Icon color */
    font-size: 16px;
}

.sidebar-channels ul li a:hover i {
    color: #ff0000; /* Red icon on hover */
}


.main-video-content {
    flex-grow: 1; /* Allows the video content to take up remaining space */
    min-width: 0; /* Ensures it can shrink on smaller screens */
    /* No background/padding here, as video-grid already has it */
}


/* Responsive adjustments */
@media (max-width: 1024px) {
    .video-page-layout {
        flex-direction: column;
        gap: 25px;
        padding: 0 15px;

    }
    .video-main-content,
    .video-sidebar {
        flex: none;
        width: 315px;
        min-width: unset;
    }
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        padding: 20px;
    }

    /* Index page layout adjustments for tablets and smaller desktops */
    .index-page-layout {
        flex-direction: column; /* Stack sidebar and main content vertically */
        padding: 0 15px;
    }

    .sidebar-channels {
        height: 300px;
        width: 300px; /* Sidebar takes full width when stacked */
        flex: none; /* Override fixed width */
        margin-bottom: 0px; /* Space between sidebar and videos */
    }
    /* Adjust header for tablets and smaller desktops */
    header {
        padding: 10px 20px;
        height: 100%;
    }
    .logo h1 {
        font-size: 22px;
    }
    .search-bar input {
        width: 250px;
        font-size: 13px;
    }
    .search-bar button {
        font-size: 13px;
    }
    .user-menu a, .user-menu span {
        font-size: 12px;
        margin: 0 7px;
    }

    /* Channel page responsive */
    .channel-page-body .channel-header-section {
        flex-direction: column; /* Stack info and actions */
        align-items: center;
        text-align: center;
    }

    .channel-page-body .channel-profile-info {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 768px) {
    /* For tablets and larger phones */
    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 15px;
        gap: 10px;
        height: 100%;

    }
    
    .sidebar-channels {
        height: 300px;
        width: 200px; /* Sidebar takes full width when stacked */
        flex: none; /* Override fixed width */
        margin-bottom: 0px; /* Space between sidebar and videos */
    }
    
    .search-bar {
        width: 100%;
        order: 3;
    }
    .search-bar input {
        width: calc(100% - 70px);
        padding: 10px;
        font-size: 14px;
    }
    .search-bar button {
        padding: 10px 15px;
        font-size: 14px;
    }
    .user-menu {
        width: 100%;
        justify-content: space-around;
        order: 2;
        margin-top: 10px;
        flex-wrap: wrap;
        gap: 5px;
    }
    .user-menu a, .user-menu span {
        font-size: 14px;
        margin: 0 5px;
        padding: 5px 0;
    }
    .logo {
        width: 100%;
        text-align: center;
        order: 1;
    }
    .logo h1 {
        font-size: 26px;
    }

    /* Video grid for mobile: 1 column */
    .video-grid {
        grid-template-columns: repeat(1, 1fr);
        padding: 15px;
        gap: 20px;
         
    }
    
     .main-video-content {
                width: 100%; /* Take full width on mobile */
                padding: 10px; /* Adjust padding for mobile */
                margin-left: -10px;
                margin-right: -10px;
            }


    .video-card {
        margin-bottom: 0;
    }
    
    /* ADDED: REMOVE UNDERLINE ON MOBILE for video titles and channel/user links */
    .video-info h3 a,
    .video-info p a {
        text-decoration: none !important;
    }

    /* ADDED: Ensure video title wrapping on mobile */
    .video-info h3 {
        white-space: normal;
        word-break: break-word;
    }
    
    .subscribe-btn {
        width: 100px;
        margin-left: -12px;
        color: black;
    }

    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Adjust for smaller screens */
        padding: 15px;
    }

    /* Admin Table Responsive adjustments - unchanged from your previous provided CSS */
    .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr {
        display: block;
    }
    .admin-table thead {
        display: none;
    }
    .admin-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    .admin-table td:before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: calc(50% - 30px);
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #555;
    }
    .admin-table td:last-child {
        border-bottom: none;
    }
    .admin-table .video-title-likes {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .admin-table .video-likes-count {
        margin-top: 5px;
    }
    
    .video-stats-bar .share-btn {
        display: none !important; /* Use !important to ensure it overrides other display properties */
    }
    
    /* Header non-sticky for video.php on mobile only */
    body.video-page-body header {
        position: static; /* Header will now scroll with the content */
        top: auto;        /* Remove sticky top offset */
        box-shadow: none; /* Remove shadow to make it look less fixed */
    }

    /* Channel page specific mobile adjustments */
    .channel-page-body .channel-large-avatar {
        width: 80px;
        height: 80px;
    }

    .channel-page-body .channel-text-info h2 {
        font-size: 24px;
    }


    .channel-page-body .channel-owner-text,
    .channel-page-body .subscriber-count,
    .channel-page-body .channel-description {
        font-size: 14px;
    }
    
}

@media (max-width: 480px) {
    /* For smaller phones */
    header {
        padding: 10px;
        height: 100%;
    }
    .logo h1 {
        font-size: 24px;
    }
    .search-bar input {
        width: calc(100% - 65px);
        padding: 8px;
    }
    .search-bar button {
        padding: 8px 12px;
    }
    .user-menu {
        gap: 3px;
    }
    .user-menu a, .user-menu span {
        font-size: 13px;
        margin: 0 3px;
        padding: 5px 0;
    }
    .logo {
        width: 100%;
        text-align: center;
        order: 1;
    }
    .logo h1 {
        font-size: 24px;
    }

    /* ADDED: REMOVE UNDERLINE ON SMALL MOBILE SCREENS */
    .video-info h3 a,
    .video-info p a {
        text-decoration: none !important;
    }

    /* ADDED: Ensure video title wrapping on small mobile */
    .video-info h3 {
        white-space: normal;
        word-break: break-word;
    }

    .video-grid {
        padding: 10px;
    }
    .video-details h2 {
        text-decoration: none;
        font-size: 20px;
    }
    .video-details p, .video-sidebar p, .comment p {
        font-size: 13px;
    }
    .video-sidebar h3 {
        font-size: 16px;
    }
    .admin-table td:before {
        width: calc(45% - 20px);
    }
 width: 12px; /* Smaller size for mobile */
        height: 12px;
        border-radius: 10%;
        margin-right: 10px; /* Adjust margin as needed */
    }

    /* You might need to adjust the width of the comment input or its container */
    .comment-prompt-area {
        padding: 8px; /* Slightly less padding on mobile */
    }
}
    
    .video-stats-bar .share-btn {
        display: none !important; /* Use !important to ensure it overrides other display properties */
    }

    /* Channel page specific mobile adjustments */
    .channel-page-body .channel-large-avatar {
        width: 100px;
        height: 100px;
    }
}
