/* ClipShare Frontend Styles */

/* Base Styles */
.clipshare-explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.clip-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clip-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.clip-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.clip-thumbnail {
    position: relative;
    width: 100%;
    height: 160px;
    background: #f0f0f0;
    overflow: hidden;
}

.clip-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #e0e0e0;
    color: #666;
}

.thumbnail-placeholder i {
    font-size: 3rem;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.clip-info {
    padding: 1rem;
}

.clip-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.channel-name {
    margin: 0 0 0.25rem 0;
    color: #666;
    font-size: 0.875rem;
}

.clip-stats {
    margin: 0;
    color: #888;
    font-size: 0.8rem;
}

/* Watch Page Styles */
.clipshare-watch-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.video-player {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.video-actions button,
.video-actions a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.video-actions button:hover,
.video-actions a:hover {
    background: #f0f0f0;
}

.btn-like.liked {
    background: #ff4757;
    color: white;
    border-color: #ff4757;
}

.btn-subscribe {
    background: #cc0000;
    color: white;
    border-color: #cc0000;
}

.btn-subscribe.subscribed {
    background: #666;
    border-color: #666;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 1rem 0;
}

.channel-avatar img {
    border-radius: 50%;
}

.channel-details {
    flex: 1;
}

.channel-name a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

.subscriber-count {
    color: #666;
    font-size: 0.875rem;
    margin: 0.25rem 0 0 0;
}

/* Channel Page Styles */
.clipshare-channel-block {
    margin: 2rem 0;
}

.channel-banner {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.channel-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.channel-avatar {
    flex-shrink: 0;
}

.channel-info {
    flex: 1;
}

.channel-name {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
}

.channel-handle {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.875rem;
}

.channel-description {
    margin: 1rem 0;
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 8px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

/* Upload Form Styles */
.clipshare-upload-page {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.upload-tabs {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    background: none;
    border: none;
    padding: 1rem 2rem;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.tab-button.active {
    border-bottom-color: #0073aa;
    color: #0073aa;
}

.tab-content {
    display: none;
}

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

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.file-upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #0073aa;
}

.file-upload-area.dragover {
    background-color: #f0f8ff;
}

.upload-placeholder i {
    font-size: 3rem;
    color: #666;
    margin-bottom: 1rem;
    display: block;
}

.upload-progress {
    margin: 1rem 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #0073aa;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* Search Styles */
.clipshare-search-bar {
    margin: 1rem 0;
}

.clipshare-search-bar form {
    display: flex;
    gap: 0.5rem;
}

.clipshare-search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.clipshare-search-bar button {
    padding: 0.75rem 1.5rem;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.close:hover {
    color: #000;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #0073aa;
    color: white;
}

.btn-primary:hover {
    background-color: #005a87;
}

.btn-secondary {
    background-color: #666;
    color: white;
}

.btn-secondary:hover {
    background-color: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    .clipshare-explore-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .clipshare-watch-page {
        padding: 0.5rem;
    }
    
    .video-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .channel-header {
        flex-direction: column;
        align-items: flex-start;
        text-align: center;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-tabs {
        flex-direction: column;
    }
    
    .tab-button {
        text-align: left;
        border-bottom: 1px solid #ddd;
        border-right: none;
    }
    
    .tab-button.active {
        border-bottom-color: #ddd;
        border-left: 3px solid #0073aa;
    }
}

@media (max-width: 480px) {
    .clipshare-explore-grid {
        grid-template-columns: 1fr;
    }
    
    .clip-card {
        margin-bottom: 1rem;
    }
    
    .modal-content {
        width: 95%;
        padding: 1rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #666;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Loading Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .clip-card {
        background: #2c2c2c;
        color: #fff;
    }
    
    .modal-content {
        background-color: #2c2c2c;
        color: #fff;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        background: #3c3c3c;
        color: #fff;
        border-color: #555;
    }
}
