/* Modern Clips Page Styling (matching _discord.css) */
.clips-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    min-height: calc(100vh - 200px);
}

.clips-main h1 {
    text-align: center;
    color: #fff;
    font-size: 2.2rem;
    margin-bottom: 30px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Grid Layout */
.clips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

/* Clip Card */
.clip-card {
    background: linear-gradient(145deg, rgba(30, 30, 45, 0.95) 0%, rgba(20, 20, 30, 0.98) 100%);
    border: 1px solid rgba(136, 136, 136, 0.15);
    border-radius: 16px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.clip-card:hover {
    border-color: rgba(88, 101, 242, 0.3);
    box-shadow: 0 12px 40px rgba(88, 101, 242, 0.2);
    transform: translateY(-5px);
}

.clip-thumbnail-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

.clip-thumbnail-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    /* Let the card click handle opening */
}

.clip-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clip-card:hover .clip-overlay {
    opacity: 1;
}

.play-icon {
    font-size: 3rem;
    color: #fff;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.clip-card:hover .play-icon {
    transform: scale(1);
}

.clip-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.clip-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.clip-meta {
    color: #aaa;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clip-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: #1e1e24;
    margin: 2% auto;
    /* 2% from the top and centered */
    border: 1px solid #444;
    width: 90%;
    max-width: 1200px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #18181b;
    border-radius: 12px 12px 0 0;
}

.modal-close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover,
.modal-close:focus {
    color: #fff;
    text-decoration: none;
}

.modal-body {
    padding: 0;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    /* Aspect ratio handling */
    min-height: 400px;
}

.modal-video {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    outline: none;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #18181b;
    border-radius: 0 0 12px 12px;
}

.modal-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    color: #fff;
}

.modal-info p {
    margin: 0;
    font-size: 0.9rem;
    color: #aaa;
}

.btn-share {
    background: #5865F2;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-share:hover {
    background: #4752c4;
}

.btn-download {
    background: #202225;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
    text-decoration: none;
    /* For anchor tag */
}

.btn-download:hover {
    background: #40444b;
}

.share-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    bottom: 50px;
    right: 20px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.share-tooltip.visible {
    opacity: 1;
}

/* Empty State */
.no-clips {
    text-align: center;
    padding: 50px;
    color: #aaa;
    font-size: 1.2rem;
    grid-column: 1 / -1;
}

.no-clips i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #555;
    display: block;
}

@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }

    .modal-video {
        max-height: none;
    }

    .modal-header,
    .modal-footer {
        padding: 10px 15px;
    }
}