/**
 * TikVideo Theme - Main Stylesheet
 * Additional styles complementing style.css
 *
 * @package TikVideo
 */

/* ===================================
   Swiper Customizations
   =================================== */

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-wrapper {
    transition-timing-function: cubic-bezier(0.25, 0.1, 0.25, 1);
}

.swiper-slide {
    background: #000;
    position: relative;
}

/* Pagination styling */
.swiper-pagination {
    bottom: 20px;
    right: 15px;
    left: auto;
    width: auto;
}

.swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
    width: 6px;
    height: 6px;
    margin: 8px 0;
    transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background: #fe2c55;
    transform: scale(1.3);
}

.swiper-pagination-bullet-active-main {
    background: #fe2c55;
}

/* Navigation arrows */
.swiper-button-prev,
.swiper-button-next {
    color: rgba(255, 255, 255, 0.7);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    color: #fff;
    background: rgba(254, 44, 85, 0.8);
    transform: scale(1.1);
}

.swiper-button-prev:after,
.swiper-button-next:after {
    font-size: 18px;
    font-weight: 700;
}

.swiper-button-prev {
    left: 15px;
}

.swiper-button-next {
    right: 15px;
}

/* Hide navigation on mobile */
@media (max-width: 768px) {
    .swiper-button-prev,
    .swiper-button-next {
        display: none;
    }
}

/* ===================================
   Video Container Enhancements
   =================================== */

.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.video-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.8) 100%
    );
    pointer-events: none;
    z-index: 1;
}

/* Thumbnail overlay improvements */
.thumbnail-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    cursor: pointer;
}

.thumbnail-overlay img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.thumbnail-overlay:hover img {
    transform: scale(1.05);
}

/* Play button animations */
.play-btn {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.play-btn svg {
    margin-left: 4px; /* Optical adjustment */
}

/* Video player enhancements */
.video-player {
    z-index: 3;
    background: #000;
}

.video-player iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===================================
   Video Meta Information Styling
   =================================== */

.video-meta {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 20px;
    z-index: 10;
    pointer-events: none;
}

.video-title {
    font-size: 1.1rem;
    line-height: 1.4;
    margin-bottom: 12px;
    max-width: 80%;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    pointer-events: auto;
}

.video-title a {
    color: #fff;
    transition: color 0.3s ease;
}

.video-title a:hover {
    color: #fe2c55;
}

.video-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.duration,
.views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.duration:hover,
.views:hover {
    background: rgba(254, 44, 85, 0.6);
    border-color: rgba(254, 44, 85, 0.3);
}

.view-more-link {
    display: inline-block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    padding: 6px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    pointer-events: auto;
}

.view-more-link:hover {
    background: rgba(254, 44, 85, 0.8);
    color: #fff;
    transform: translateY(-2px);
}

/* ===================================
   Load More Button
   =================================== */

.load-more-btn {
    background: linear-gradient(135deg, #fe2c55, #ff4d73);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.3);
}

.load-more-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(254, 44, 85, 0.5);
}

.load-more-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.load-more-btn:disabled {
    background: #333;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
}

/* ===================================
   Single Post Page Enhancements
   =================================== */

.single-video-container {
    background: linear-gradient(to bottom, #0a0a0a, #111);
}

.single-video-player {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
}

.single-video-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
    pointer-events: none;
}

.single-video-info {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.single-video-description {
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.85);
}

.single-video-tags a {
    transition: all 0.2s ease;
}

.single-video-tags a:hover {
    transform: translateY(-2px);
}

/* ===================================
   Archive Grid Enhancements
   =================================== */

.archive-header {
    background: linear-gradient(135deg, #1a1a1a, #0a0a0a);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.archive-header h1 {
    position: relative;
    display: inline-block;
}

.archive-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #fe2c55, #ff4d73);
    border-radius: 2px;
}

.video-grid-item {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.video-grid-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.9) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-grid-item:hover::after {
    opacity: 1;
}

.video-grid-overlay {
    z-index: 2;
}

.video-grid-title {
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-grid-item img {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.video-grid-item:hover img {
    transform: scale(1.1);
}

/* ===================================
   Loading States & Animations
   =================================== */

.spinner {
    border-width: 3px;
}

.loading .spinner {
    animation: spin 0.8s linear infinite;
}

/* Fade in animation for slides */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.swiper-slide {
    animation: fadeIn 0.5s ease-out;
}

/* Skeleton loading for video cards */
.skeleton {
    background: linear-gradient(
        90deg,
        #1a1a1a 25%,
        #2a2a2a 50%,
        #1a1a1a 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===================================
   Responsive Adjustments
   =================================== */

@media (max-width: 768px) {
    .video-meta {
        padding: 40px 15px 15px;
    }

    .video-title {
        font-size: 1rem;
        max-width: 100%;
    }

    .duration,
    .views {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    .single-video-container {
        padding: 60px 10px 20px;
    }

    .single-video-info {
        padding: 20px 15px;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (min-width: 769px) {
    .video-swiper {
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        border-radius: 12px;
        overflow: hidden;
    }

    .video-meta {
        padding: 80px 30px 30px;
    }

    .video-title {
        font-size: 1.3rem;
    }
}

/* ===================================
   Dark Mode Support (Future Enhancement)
   =================================== */

:root {
    --tikvideo-bg-primary: #000000;
    --tikvideo-bg-secondary: #0a0a0a;
    --tikvideo-bg-tertiary: #161616;
    --tikvideo-text-primary: #ffffff;
    --tikvideo-text-secondary: rgba(255, 255, 255, 0.7);
    --tikvideo-accent: #fe2c55;
    --tikvideo-accent-hover: #ff4d73;
}

/* ===================================
   User Authentication & Profile Styles
   =================================== */

/* Header Navigation */
.main-navigation {
    display: block;
}

.primary-menu-list {
    display: flex;
    list-style: none;
    gap: 5px;
    margin: 0;
    padding: 0;
}

.primary-menu-list li {
    margin: 0;
}

.primary-menu-list a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
}

.primary-menu-list a:hover {
    background: rgba(254, 44, 85, 0.8);
    color: #fff;
    transform: translateY(-2px);
}

/* Header User Actions */
.user-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.login-toggle-btn {
    background: linear-gradient(135deg, #fe2c55, #ff4d73);
    color: #fff;
    border: none;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(254, 44, 85, 0.4);
}

/* User Menu */
.user-menu-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.user-profile-link:hover {
    opacity: 0.8;
}

.user-nickname {
    font-size: 0.9rem;
    font-weight: 600;
}

.logout-btn {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    color: #fe2c55;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Mobile Navigation */
.mobile-navigation {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(20px);
    padding: 20px;
    z-index: 999;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-navigation.active {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mobile-menu-list {
    list-style: none;
    margin-bottom: 20px;
}

.mobile-menu-list li {
    margin-bottom: 15px;
}

.mobile-menu-list a {
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
    display: block;
    padding: 10px 0;
}

.mobile-auth-buttons {
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #fe2c55, #ff4d73);
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 400px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: #fff;
    border-bottom-color: #fe2c55;
}

.tab-content {
    display: none;
}

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

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #fe2c55;
    background: rgba(255, 255, 255, 0.15);
}

.btn-submit {
    width: 100%;
    background: linear-gradient(135deg, #fe2c55, #ff4d73);
    color: #fff;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(254, 44, 85, 0.4);
}

.form-note {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 8px;
    text-align: center;
}

/* Search Modal */
.search-modal-content {
    max-width: 600px;
}

.search-modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #fff;
}

.search-input-wrapper {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.search-input-wrapper input {
    flex: 1;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #fff;
    font-size: 1rem;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: #fe2c55;
    background: rgba(255, 255, 255, 0.15);
}

.search-submit-btn {
    background: linear-gradient(135deg, #fe2c55, #ff4d73);
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(254, 44, 85, 0.4);
}

.search-suggestions {
    color: rgba(255, 255, 255, 0.8);
}

.search-suggestions p {
    margin-bottom: 15px;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tags a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.search-tags a:hover {
    background: rgba(254, 44, 85, 0.3);
    color: #fff;
}

/* Mobile Menu Enhancements */
.mobile-menu-list {
    list-style: none;
    margin-bottom: 20px;
}

.mobile-menu-list li {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.mobile-menu-list li:last-child {
    border-bottom: none;
}

.mobile-menu-list a {
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
    display: block;
    padding: 10px 0;
    transition: all 0.3s ease;
}

.mobile-menu-list a:hover {
    color: #fe2c55;
    transform: translateX(5px);
}

.mobile-user-info {
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-profile-link {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    text-decoration: none;
    padding: 15px 0;
    margin-bottom: 15px;
}

.mobile-profile-link img {
    border-radius: 50%;
    border: 2px solid #fe2c55;
}

.mobile-profile-link span {
    font-size: 1.1rem;
    font-weight: 600;
}

.mobile-logout-btn {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 10px 0;
    font-size: 0.95rem;
}

.mobile-logout-btn:hover {
    color: #fe2c55;
}

/* My Account Page */
.my-account-container {
    max-width: 800px;
    margin: 100px auto;
    padding: 40px 20px;
}

.my-account-container h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #fff;
}

.account-profile {
    display: flex;
    align-items: center;
    gap: 30px;
    background: #161616;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.profile-avatar img {
    border-radius: 50%;
    border: 3px solid #fe2c55;
}

.profile-info h2 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.profile-info p {
    color: rgba(255, 255, 255, 0.6);
}

.account-settings {
    background: #161616;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.account-settings h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.account-actions {
    text-align: right;
}

.btn-logout {
    display: inline-block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    padding: 10px 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.btn-logout:hover {
    color: #fe2c55;
    border-color: #fe2c55;
}

/* Responsive adjustments for user elements */
@media (max-width: 768px) {
    .site-header {
        padding: 12px 15px;
    }

    .site-title {
        font-size: 1.2rem;
    }

    /* Hide desktop navigation on mobile */
    .main-navigation {
        display: none !important;
    }

    .user-actions {
        gap: 10px;
    }

    .login-toggle-btn {
        padding: 6px 15px;
        font-size: 0.85rem;
    }

    .mobile-menu-toggle {
        display: flex !important;
    }

    .user-nickname {
        display: none;
    }

    .account-profile {
        flex-direction: column;
        text-align: center;
    }
}

/* Desktop-only styles */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }

    .mobile-navigation {
        display: none !important;
    }
}

/* ===================================
   Accessibility Improvements
   =================================== */

/* Focus states */
button:focus,
a:focus {
    outline: 2px solid #fe2c55;
    outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid #fe2c55;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .duration,
    .views {
        border: 2px solid #fff;
    }

    .play-btn {
        border: 3px solid #fff;
    }
}
