/* YouTube Clone Website - Modern Styling */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0f0f0f;
    color: #ffffff;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: #212121;
    border-bottom: 1px solid #303030;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.logo a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.search-form {
    flex: 1;
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    background-color: #121212;
    border: 1px solid #303030;
    color: #ffffff;
    font-size: 16px;
    border-radius: 40px 0 0 40px;
    outline: none;
}

.search-input:focus {
    border-color: #1a73e8;
}

.search-btn {
    padding: 10px 24px;
    background-color: #303030;
    border: 1px solid #303030;
    border-left: none;
    color: #ffffff;
    cursor: pointer;
    border-radius: 0 40px 40px 0;
    font-size: 18px;
}

.search-btn:hover {
    background-color: #404040;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn-primary {
    padding: 10px 20px;
    background-color: #1a73e8;
    color: #ffffff;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #1557b0;
}

.btn-secondary {
    padding: 10px 20px;
    background-color: #303030;
    color: #ffffff;
    text-decoration: none;
    border-radius: 20px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #404040;
}

/* Main Content */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.page-title {
    font-size: 24px;
    margin-bottom: 24px;
    font-weight: 500;
}

/* Videos Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.video-card {
    background-color: #181818;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, background-color 0.2s;
    cursor: pointer;
}

.video-card:hover {
    transform: scale(1.02);
    background-color: #212121;
}

.video-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-color: #000;
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #ffffff;
}

.video-channel {
    font-size: 14px;
    color: #aaaaaa;
    margin-bottom: 4px;
}

.video-stats {
    font-size: 14px;
    color: #aaaaaa;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Watch Page */
.watch-page {
    padding: 30px 0;
}

.watch-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 24px;
}

.video-section {
    min-width: 0;
}

.video-player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background-color: #000;
    border-radius: 12px;
    margin-bottom: 16px;
}

#youtube-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.video-info-section {
    background-color: #181818;
    padding: 20px;
    border-radius: 12px;
}

.video-title-main {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #303030;
}

.video-stats-main {
    color: #aaaaaa;
    font-size: 14px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.video-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    padding: 8px 16px;
    background-color: #272727;
    border: none;
    color: #ffffff;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #3d3d3d;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #303030;
}

.channel-avatar {
    flex-shrink: 0;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: #1a73e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.channel-details {
    flex: 1;
}

.channel-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.channel-subscribers {
    font-size: 14px;
    color: #aaaaaa;
}

.subscribe-btn {
    padding: 10px 20px;
    background-color: #cc0000;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.subscribe-btn:hover {
    background-color: #aa0000;
}

.video-description {
    color: #aaaaaa;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Related Videos */
.related-videos {
    min-width: 0;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 16px;
}

.related-video-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.related-video-item:hover {
    opacity: 0.8;
}

.related-thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 168px;
    height: 94px;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background-color: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #ffffff;
}

.related-channel {
    font-size: 12px;
    color: #aaaaaa;
    margin-bottom: 4px;
}

.related-stats {
    font-size: 12px;
    color: #aaaaaa;
}

/* Add Video Form */
.add-video-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #ffffff;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background-color: #181818;
    border: 1px solid #303030;
    color: #ffffff;
    font-size: 16px;
    border-radius: 8px;
    outline: none;
}

.form-input:focus {
    border-color: #1a73e8;
}

.form-help {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #aaaaaa;
}

.btn-large {
    padding: 12px 32px;
    font-size: 16px;
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.alert-success {
    background-color: #1e4620;
    color: #4caf50;
    border: 1px solid #4caf50;
}

.alert-error {
    background-color: #4a1e1e;
    color: #f44336;
    border: 1px solid #f44336;
}

.info-box {
    margin-top: 32px;
    padding: 20px;
    background-color: #181818;
    border-radius: 8px;
    border: 1px solid #303030;
}

.info-box h3 {
    margin-bottom: 12px;
    color: #1a73e8;
}

.info-box ul {
    list-style: none;
    padding-left: 0;
}

.info-box li {
    padding: 8px 0;
    color: #aaaaaa;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #aaaaaa;
}

.empty-state a {
    color: #1a73e8;
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background-color: #181818;
    border-top: 1px solid #303030;
    padding: 24px 0;
    margin-top: 60px;
    text-align: center;
}

.footer p {
    color: #aaaaaa;
    font-size: 14px;
    margin-bottom: 8px;
}

.footer-note {
    color: #1a73e8 !important;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .watch-layout {
        grid-template-columns: 1fr;
    }
    
    .related-videos {
        margin-top: 32px;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }
    
    .search-form {
        order: 3;
        width: 100%;
        margin-top: 12px;
    }
    
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
}

