/* ========================================
   Video Details Page - Modern & Responsive
   ======================================== */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #fe2c55;
    --secondary-color: #f12950;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-dark: #161823;
    --text-gray: #8a8a8e;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Container ===== */
.video-details-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    direction: rtl;
}

/* ===== Back Button ===== */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-dark);
    text-decoration: none;
    font-family: "Rubik", sans-serif;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    margin-bottom: 2rem;
}

.back-button:hover {
    background: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

/* ===== Page Header ===== */
.details-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.details-title {
    font-family: "Rubik", sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
    flex: 1;
}

.header-badges {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-family: "Rubik", sans-serif;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-auction {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
}

.badge-auction-closed {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: white;
}

.badge-ad {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.badge-active {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.badge-closed {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

/* ===== Main Content Grid ===== */
.details-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 2rem;
}

/* ===== Media Section ===== */
.media-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.media-player {
    position: relative;
    width: 100%;
    height: 600px;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-left: 1rem; /* Add left margin for spacing */
}

.video-player-wrapper,
.image-display-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.media-display {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Play/Pause Overlay */
.play-pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
}

.play-pause-overlay:hover {
    opacity: 1;
}

.play-pause-overlay.active {
    background: rgba(0, 0, 0, 0.1);
}

.play-pause-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.play-pause-btn:hover {
    transform: scale(1.1);
    background: white;
}

/* Mute Button */
.mute-btn {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.mute-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Media Type Indicator */
.media-type-indicator {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    font-family: "Rubik", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: white;
    backdrop-filter: blur(8px);
    z-index: 10;
}

.media-type-indicator.video-type {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.95), rgba(37, 99, 235, 0.95));
}

.media-type-indicator.image-type {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95));
}

/* Media Navigation Buttons */
.media-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    color: var(--text-dark);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    z-index: 30;
}

.media-nav-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.prev-btn {
    right: 1.5rem;
}

.next-btn {
    left: 1.5rem;
}

/* No Media */
.no-media {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-media-placeholder {
    font-family: "Rubik", sans-serif;
    font-size: 18px;
    color: var(--text-gray);
}

/* Media Thumbnails Grid */
.media-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
}

.thumbnail-item {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
    box-shadow: var(--shadow-sm);
}

.thumbnail-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.thumbnail-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(254, 44, 85, 0.2);
}

.thumbnail-video {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.9), rgba(37, 99, 235, 0.9));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

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

/* ===== Info Section ===== */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.info-card:hover {
    box-shadow: var(--shadow-md);
}

.card-title {
    font-family: "Rubik", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* User Info Card */
.user-profile {
    display: flex;
    gap: 1.5rem;
}

.user-avatar-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    flex-shrink: 0;
}

.user-avatar-placeholder-large {
    width: 100px;
    height: 100px;
    color: var(--text-gray);
    flex-shrink: 0;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.user-name {
    font-family: "Rubik", sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.user-username {
    font-family: "Rubik", sans-serif;
    font-size: 14px;
    color: var(--text-gray);
    margin: 0;
}

.user-contact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Rubik", sans-serif;
    font-size: 13px;
    color: var(--text-gray);
}

.contact-item svg {
    color: var(--primary-color);
    font-size: 14px;
}

.user-join-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: "Rubik", sans-serif;
    font-size: 13px;
    color: var(--text-gray);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.user-join-date svg {
    color: var(--primary-color);
}

/* Property Details Card */
.property-details-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: "Rubik", sans-serif;
    font-size: 14px;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

.detail-label {
    font-weight: 700;
    color: var(--text-dark);
    min-width: 80px;
}

.detail-value {
    color: var(--text-gray);
    font-weight: 500;
}

.detail-icon {
    font-size: 16px;
    color: var(--primary-color);
    flex-shrink: 0;
}

.detail-row.price-row {
    background: linear-gradient(135deg, #fef3f2, #fee);
    border-right: 4px solid var(--primary-color);
}

.price-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 18px;
}

/* Auction Info Card */
.auction-info-card {
    border: 2px solid var(--primary-color);
}

.auction-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auction-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    font-family: "Rubik", sans-serif;
}

.auction-detail-row.highlight {
    background: linear-gradient(135deg, #fef3f2, #fee);
    border: 2px solid var(--primary-color);
}

.auction-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.auction-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
}

.auction-value.price {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.auction-status {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
}

.auction-status.active {
    background: var(--success-color);
    color: white;
}

.auction-status.closed {
    background: var(--text-gray);
    color: white;
}

/* Winner Section */
.winner-section {
    background: linear-gradient(135deg, #fef3f2, #fff9f0);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1rem;
    border: 2px solid #ffd700;
}

.winner-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ffd700;
}

.trophy-icon {
    font-size: 24px;
    color: #ffd700;
}

.winner-header h3 {
    font-family: "Rubik", sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.winner-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.winner-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Rubik", sans-serif;
}

.winner-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.winner-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-gray);
}

.winner-value.final-price {
    font-size: 18px;
    font-weight: 700;
    color: #ffd700;
}

/* Bids Summary */
.bids-summary {
    text-align: center;
    padding: 0.75rem;
    background: white;
    border-radius: var(--radius-md);
    margin-top: 0.5rem;
}

.bids-count {
    font-family: "Rubik", sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

/* Additional Info Card */
.additional-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

/* Tablet */
@media (max-width: 1024px) {
    .video-details-container {
        padding: 1.5rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .media-player {
        height: 500px;
        margin-left: 0.75rem; /* Adjust for tablet */
    }

    .details-title {
        font-size: 24px;
    }

    .play-pause-btn {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    .mute-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .media-nav-btn {
        width: 48px;
        height: 48px;
        font-size: 28px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .video-details-container {
        padding: 1rem;
    }

    .details-header {
        padding: 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .details-title {
        font-size: 20px;
    }

    .badge {
        font-size: 12px;
        padding: 0.4rem 0.75rem;
    }

    .media-player {
        height: 400px;
        margin-left: 0.5rem; /* Adjust for mobile */
    }

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

    .user-avatar-large,
    .user-avatar-placeholder-large {
        width: 80px;
        height: 80px;
    }

    .user-name {
        font-size: 18px;
    }

    .media-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 0.75rem;
    }

    .play-pause-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }

    .mute-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 1rem;
        left: 1rem;
    }

    .media-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .prev-btn {
        right: 1rem;
    }

    .next-btn {
        left: 1rem;
    }

    .info-card {
        padding: 1.25rem;
    }

    .card-title {
        font-size: 16px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .video-details-container {
        padding: 0.75rem;
    }

    .details-header {
        padding: 1rem;
    }

    .details-title {
        font-size: 18px;
    }

    .media-player {
        height: 300px;
        margin-left: 0.25rem; /* Adjust for small mobile */
    }

    .user-avatar-large,
    .user-avatar-placeholder-large {
        width: 70px;
        height: 70px;
    }

    .media-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 0.5rem;
    }

    .play-pause-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .mute-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .media-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .media-type-indicator {
        font-size: 11px;
        padding: 0.375rem 0.625rem;
        top: 1rem;
        left: 1rem;
    }

    .back-button {
        padding: 0.625rem 1rem;
        font-size: 13px;
    }
}
