/**
 * Musawwada Portfolio Widget Styles
 * Supports both light and dark backgrounds
 */

/* CSS Variables (Light Background Default) */
.musawwada-portfolio-wrapper {
    --msp-primary: #352460;
    --msp-secondary: #EFBC21;
    --msp-text: #352460;
    --msp-text-light: #666666;
    --msp-accent: #61CE70;
    --msp-cyan: #17808C;
    --msp-teal: #49CFBA;
    --msp-gray: #888888;
    --msp-card-bg: #ffffff;
    --msp-card-border: rgba(53, 36, 96, 0.1);
    --msp-border: rgba(53, 36, 96, 0.1);
    --msp-radius: 20px;
    --msp-font: 'Cairo', sans-serif;
}

/* Wrapper */
.musawwada-portfolio-wrapper {
    font-family: var(--msp-font);
    direction: rtl;
    position: relative;
    z-index: 1;
}

/* Header */
.msp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--msp-border);
    flex-wrap: wrap;
    gap: 20px;
}

.msp-header-content {
    max-width: 700px;
}

.msp-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 188, 33, 0.15);
    color: var(--msp-secondary);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 15px;
    border: 1px solid rgba(239, 188, 33, 0.3);
}

.msp-badge i {
    font-size: 0.8rem;
}

.msp-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.2;
    color: var(--msp-text);
}

.msp-subtitle {
    font-size: 1.1rem;
    color: var(--msp-gray);
    line-height: 1.6;
    margin: 0;
}

/* CTA Button */
.msp-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    background: linear-gradient(135deg, var(--msp-secondary) 0%, #f7d05e 100%);
    color: var(--msp-primary);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(239, 188, 33, 0.2);
    flex-shrink: 0;
}

.msp-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(239, 188, 33, 0.3);
    background: #fff;
}

.msp-cta i {
    font-size: 1.2rem;
}

/* Filters */
.msp-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
}

.msp-filter-btn {
    background: #f8f8f8;
    border: 1px solid var(--msp-border);
    padding: 12px 28px;
    border-radius: 50px;
    color: var(--msp-gray);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.msp-filter-btn:hover {
    background: var(--msp-primary);
    color: #fff;
    transform: translateY(-2px);
    border-color: var(--msp-primary);
}

.msp-filter-btn.active {
    background: linear-gradient(135deg, var(--msp-cyan) 0%, var(--msp-teal) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(23, 128, 140, 0.3);
}

/* Grid */
.msp-grid {
    display: grid;
    gap: 40px;
}

.msp-grid-1 {
    grid-template-columns: 1fr;
}

.msp-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.msp-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.msp-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.msp-grid:not(.msp-grid-1):not(.msp-grid-2):not(.msp-grid-3):not(.msp-grid-4) {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* Card */
.msp-card {
    background: var(--msp-card-bg);
    border-radius: var(--msp-radius);
    border: 1px solid var(--msp-card-border);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(53, 36, 96, 0.08);
}

.msp-card:hover {
    transform: translateY(-10px);
    border-color: var(--msp-teal);
    box-shadow: 0 20px 40px rgba(53, 36, 96, 0.15), 0 0 20px rgba(73, 207, 186, 0.1);
}

.msp-card.hidden {
    display: none;
}

/* Browser Header */
.msp-browser-header {
    background: rgba(0, 0, 0, 0.3);
    height: 32px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.msp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    opacity: 0.6;
}

.msp-dot-red {
    background: #ff5f56;
}

.msp-dot-yellow {
    background: #ffbd2e;
}

.msp-dot-green {
    background: #27c93f;
}

/* Card Image */
.msp-card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--msp-primary) 0%, var(--msp-cyan) 100%);
}

.msp-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.msp-card:hover .msp-card-image img {
    transform: scale(1.1);
    filter: brightness(0.7);
}

.msp-placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.2);
}

/* Card Overlay */
.msp-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.msp-overlay-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--msp-secondary);
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.msp-card:hover .msp-card-overlay {
    opacity: 1;
}

.msp-card:hover .msp-overlay-icon {
    transform: scale(1);
}

/* Card Content */
.msp-card-content {
    padding: 25px;
}

.msp-card-category {
    display: block;
    font-size: 0.8rem;
    color: var(--msp-teal);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.msp-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.3;
    color: var(--msp-text);
}

.msp-card-desc {
    font-size: 0.95rem;
    color: var(--msp-gray);
    line-height: 1.6;
    margin: 0 0 20px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Footer */
.msp-card-footer {
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.msp-view-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--msp-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.msp-view-link:hover {
    color: var(--msp-secondary);
}

.msp-view-link i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.msp-view-link:hover i {
    transform: translateX(-5px);
}

/* No Items Message */
.msp-no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--msp-gray);
    font-size: 1.1rem;
}

/* Animations */
@keyframes mspFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msp-card {
    animation: mspFadeIn 0.5s ease forwards;
}

/* Responsive */
@media (max-width: 992px) {
    .msp-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .msp-header-content {
        text-align: center;
    }

    .msp-title {
        font-size: 2.5rem;
    }

    .msp-grid-3,
    .msp-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {

    .msp-grid,
    .msp-grid-2,
    .msp-grid-3,
    .msp-grid-4 {
        grid-template-columns: 1fr;
    }

    .msp-filters {
        gap: 10px;
    }

    .msp-filter-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .msp-title {
        font-size: 2rem;
    }

    .msp-header {
        padding-bottom: 20px;
        border: none;
    }
}

/* ========================================
   WhatsApp Button
   ======================================== */

.msp-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 35px;
    background: linear-gradient(135deg, #EFBC21 0%, #f7d05e 100%);
    color: #352460;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 800;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(239, 188, 33, 0.2);
    flex-shrink: 0;
}

.msp-whatsapp:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(239, 188, 33, 0.3);
}

.msp-whatsapp i {
    font-size: 1.2rem;
}

/* WhatsApp Bottom Position */
.msp-whatsapp-container {
    display: flex;
    justify-content: center;
    margin-top: 50px;
}

/* WhatsApp Floating Position */
.msp-whatsapp-floating {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
}

/* ========================================
   Popup / Lightbox
   ======================================== */

.msp-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.msp-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.msp-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    z-index: 100000;
}

.msp-popup-close:hover {
    transform: rotate(90deg);
}

.msp-popup-content {
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msp-popup-content iframe {
    width: 100%;
    height: 100%;
    max-width: 1200px;
    max-height: 80vh;
    border: none;
    border-radius: 10px;
}

.msp-popup-content video {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
}

.msp-popup-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    object-fit: contain;
}

/* Popup Loading */
.msp-popup-loading {
    color: #fff;
    font-size: 1.5rem;
}

/* Card Footer Border for Light Theme */
.msp-card-footer {
    border-top-color: var(--msp-border);
}

/* ========================================
   Video Player Styles
   ======================================== */

.msp-video-wrapper {
    width: 100%;
    max-width: 90vw;
    height: 80vh;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* VideoJS Container Styling */
.video-js {
    width: 100% !important;
    height: 100% !important;
    max-width: 1000px;
    max-height: 100%;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Ensure video fits inside */
.video-js .vjs-tech {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

/* Standard VideoJS Button Colors */
.video-js .vjs-big-play-button {
    background-color: rgba(239, 188, 33, 0.9);
    border: none;
    border-radius: 50%;
    width: 2em;
    height: 2em;
    line-height: 2em;
    margin-left: -1em;
    margin-top: -1em;
}

.video-js .vjs-big-play-button:hover {
    background-color: var(--msp-secondary);
    border-color: var(--msp-primary);
    color: var(--msp-primary);
}

.video-js .vjs-control-bar {
    background-color: rgba(0, 0, 0, 0.7);
    display: flex !important;
}

/* ========================================
   PDF Viewer Styles
   ======================================== */

.msp-pdf-wrapper {
    width: 100%;
    height: 80vh;
    max-width: 90vw;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.msp-pdf-wrapper iframe {
    width: 100% !important;
    height: 100% !important;
    min-height: 70vh;
    border: none !important;
    border-radius: 12px;
}

.msp-pdf-wrapper embed {
    width: 100%;
    height: 100%;
    min-height: 75vh;
    border: none;
    border-radius: 12px;
    background: #fff;
}

.msp-pdf-wrapper object {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border-radius: 12px;
}

.msp-pdf-wrapper object iframe {
    width: 100%;
    height: 100%;
    min-height: 70vh;
}

/* Mobile PDF View */
.msp-pdf-mobile-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #352460 0%, #17808C 100%);
    border-radius: 20px;
    min-height: 300px;
    gap: 20px;
}

.msp-pdf-icon {
    font-size: 4rem;
    color: #EFBC21;
}

.msp-pdf-message {
    color: #fff;
    font-size: 1.1rem;
    margin: 0;
    max-width: 280px;
    line-height: 1.6;
}

.msp-pdf-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 30px;
    background: linear-gradient(135deg, #EFBC21 0%, #f7d05e 100%);
    color: #352460;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.msp-pdf-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.msp-pdf-button.msp-pdf-download {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.msp-pdf-button.msp-pdf-download:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Mobile adjustments for PDF */
@media (max-width: 768px) {
    .msp-pdf-wrapper {
        height: 70vh;
        max-width: 95vw;
    }

    .msp-pdf-wrapper iframe,
    .msp-pdf-wrapper object,
    .msp-pdf-wrapper embed {
        min-height: 60vh;
    }

    .msp-pdf-mobile-view {
        padding: 30px 15px;
        min-height: 250px;
    }

    .msp-pdf-icon {
        font-size: 3rem;
    }

    .msp-pdf-message {
        font-size: 1rem;
    }
}