﻿/* Ultra Modern Select2 Styling */
.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--single {
    height: 44px !important;
    border: 2px solid #e1e8ed !important;
    border-radius: 10px !important;
    padding: 0 15px !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
}

    .select2-container--default .select2-selection--single:hover {
        border-color: #0088CC !important;
        box-shadow: 0 4px 8px rgba(0, 136, 204, 0.12) !important;
        transform: translateY(-1px);
    }

.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0088CC !important;
    box-shadow: 0 0 0 4px rgba(0, 136, 204, 0.15), 0 4px 12px rgba(0, 136, 204, 0.2) !important;
    background: #ffffff !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px !important;
    padding: 0 25px 0 0 !important;
    color: #2c3e50 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #95a5a6 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 42px !important;
    right: 12px !important;
    width: 20px !important;
}

    .select2-container--default .select2-selection--single .select2-selection__arrow b {
        border-color: #0088CC transparent transparent transparent !important;
        border-width: 7px 6px 0 6px !important;
        margin-top: -2px !important;
        transition: transform 0.3s ease !important;
    }

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(180deg);
    border-color: #0088CC transparent transparent transparent !important;
}

.select2-dropdown {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 136, 204, 0.1) !important;
    margin-top: 6px !important;
    overflow: hidden !important;
}

.select2-search--dropdown {
    padding: 12px !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
}

    .select2-search--dropdown .select2-search__field {
        border: 2px solid #e1e8ed !important;
        border-radius: 8px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
        background: #ffffff !important;
        transition: all 0.3s ease !important;
    }

        .select2-search--dropdown .select2-search__field:focus {
            border-color: #0088CC !important;
            outline: none !important;
            box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.1) !important;
        }

.select2-results {
    padding: 4px 0 !important;
}

.select2-results__option {
    padding: 12px 16px !important;
    font-size: 14px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    margin: 2px 8px !important;
    border-radius: 8px !important;
}

.select2-results__option--highlighted {
    background: linear-gradient(135deg, #0088CC 0%, #00a1f2 100%) !important;
    color: #fff !important;
    transform: translateX(-3px);
}

.select2-results__option[aria-selected="true"] {
    background: linear-gradient(135deg, #e8f4f8 0%, #d4e9f5 100%) !important;
    color: #0088CC !important;
    font-weight: 600 !important;
    border-right: 3px solid #0088CC !important;
}

    .select2-results__option[aria-selected="true"]:hover {
        background: linear-gradient(135deg, #0088CC 0%, #00a1f2 100%) !important;
        color: #fff !important;
    }

/* Color Selector Styling */
.product-color-selector {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.color-select-wrapper {
    position: relative;
}

.color-label {
    display: block;
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
    font-weight: 500;
}

.color-select-message {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
    padding: 6px 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin-top: 8px;
}

    .color-select-message.hidden {
        display: none;
    }

/* Premium Modern Table Styling */
.product-options-table {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 136, 204, 0.05);
    border: 1px solid rgba(0, 136, 204, 0.1);
    height: fit-content;
}

.table-header {
    padding-bottom: 18px;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, #0088CC 0%, #00a1f2 100%) 1;
    margin-bottom: 20px;
}

    .table-header h4 {
        color: #2c3e50;
        font-weight: 700;
        font-size: 18px;
        letter-spacing: -0.3px;
    }

.modern-table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
}

    .modern-table thead th {
        background: linear-gradient(135deg, #0088CC 0%, #006ba3 100%);
        color: #fff;
        font-weight: 600;
        padding: 16px 14px;
        border: none;
        text-align: right;
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        position: relative;
    }

        .modern-table thead th:not(:last-child)::after {
            content: '';
            position: absolute;
            left: 0;
            top: 20%;
            height: 60%;
            width: 1px;
            background: rgba(255, 255, 255, 0.2);
        }

        .modern-table thead th:first-child {
            border-top-right-radius: 12px;
        }

        .modern-table thead th:last-child {
            border-top-left-radius: 12px;
        }

    .modern-table tbody tr {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-bottom: 1px solid #f0f4f8;
        background: #ffffff;
    }

        .modern-table tbody tr:last-child {
            border-bottom: none;
        }

        .modern-table tbody tr:hover {
            background: linear-gradient(135deg, #f8fbff 0%, #e8f4f8 100%);
            transform: scale(1.01);
            box-shadow: 0 2px 8px rgba(0, 136, 204, 0.1);
        }

    .modern-table tbody td {
        padding: 16px 14px;
        vertical-align: middle;
        border: none;
        color: #34495e;
        font-size: 14px;
        font-weight: 400;
    }

        .modern-table tbody td:first-child {
            font-weight: 600;
            color: #0088CC;
            font-family: 'Courier New', monospace;
        }

        .modern-table tbody td:nth-child(2) {
            font-weight: 500;
            color: #2c3e50;
        }

        .modern-table tbody td:nth-child(3),
        .modern-table tbody td:nth-child(4) {
            color: #5a6c7d;
        }

        .modern-table tbody td:nth-child(5) {
            font-weight: 600;
            color: #0088CC;
            font-size: 15px;
        }

/* Modern Button Styling */
.cart-action-btn {
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 500 !important;
    font-size: 13px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

    .cart-action-btn.btn-primary {
        background: linear-gradient(135deg, #0088CC 0%, #00a1f2 100%) !important;
        color: #fff !important;
    }

        .cart-action-btn.btn-primary:hover {
            background: linear-gradient(135deg, #0077b3 0%, #0088CC 100%) !important;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 136, 204, 0.3) !important;
        }

    .cart-action-btn.btn-danger {
        background: linear-gradient(135deg, #dc3545 0%, #e85d6d 100%) !important;
        color: #fff !important;
    }

        .cart-action-btn.btn-danger:hover {
            background: linear-gradient(135deg, #c82333 0%, #dc3545 100%) !important;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3) !important;
        }

    .cart-action-btn:active {
        transform: translateY(0) !important;
    }

/* Product Details Link Styling */
.product-details-link {
    transition: all 0.3s ease;
}

    .product-details-link:hover {
        color: #0088CC !important;
        text-decoration: underline !important;
    }

/* View Cart Button Styling */
.view-cart-btn {
    border: 2px solid #0088CC;
    color: #0088CC;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

    .view-cart-btn:hover {
        background: linear-gradient(135deg, #0088CC 0%, #00a1f2 100%);
        color: #fff;
        border-color: #0088CC;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(0, 136, 204, 0.3);
    }
/* Product Details Section Styling */
.product-details-wrapper {
    padding: 0;
}

.product-name-section {
    margin-bottom: 1.5rem;
}

.product-title {
    font-size: 2rem;
    line-height: 1.3;
    color: #2c3e50;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-details-link-wrapper {
    margin-bottom: 1.5rem;
}

.product-details-link {
    font-size: 0.875rem;
    color: #6c757d;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: #f8f9fa;
    border: 1px solid transparent;
}

    .product-details-link:hover {
        color: #0088CC;
        background-color: #e8f4f8;
        text-decoration: none;
        transform: translateX(-3px);
        border-color: #0088CC;
        box-shadow: 0 2px 4px rgba(0, 136, 204, 0.1);
    }

    .product-details-link i {
        transition: transform 0.3s ease;
    }

    .product-details-link:hover i {
        transform: rotate(90deg);
    }

.product-description-section {
    margin-bottom: 2rem;
}

.product-description {
    padding: 1.25rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    border-right: 4px solid #0088CC;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

    .product-description:hover {
        box-shadow: 0 4px 12px rgba(0, 136, 204, 0.1);
        transform: translateY(-2px);
    }

    .product-description p {
        line-height: 1.8;
        color: #495057;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

.product-summary {
    padding: 1rem 1.25rem;
    background-color: #ffffff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

    .product-summary:hover {
        border-color: #0088CC;
        box-shadow: 0 2px 8px rgba(0, 136, 204, 0.08);
    }

    .product-summary p {
        line-height: 1.7;
        color: #6c757d;
        margin: 0;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

/* New Ad Container Styling - Improved */
.advertisement-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 2px solid #0088CC;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 136, 204, 0.08);
    height: auto;
    overflow: hidden;
}

    .advertisement-container:hover {
        box-shadow: 0 8px 24px rgba(0, 136, 204, 0.15);
        transform: translateY(-3px);
        border-color: #00a1f2;
    }

.ad-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    min-height: 350px;
    gap: 16px;
    width: 100%;
}

.ad-header-section {
    flex-shrink: 0;
    width: 100%;
}

.ad-media-section {
    flex-grow: 1;
    flex-shrink: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.ad-text-section {
    flex-shrink: 0;
    width: 100%;
}

/* تنسيق حاوية الميديا لضبط الفيديو بنسبة (16:9) - Improved */
.ad-media-placeholder {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-top: 56.25%; /* نسبة 16:9 */
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 auto;
    border: 1px solid rgba(0, 136, 204, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

    .ad-media-placeholder img,
    .ad-media-placeholder iframe,
    .ad-media-placeholder video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border: none;
        border-radius: 12px;
    }

/* تنسيق النص - متوافق مع الموقع - Improved */
#adTitle {
    color: #0088CC;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
    flex-shrink: 0;
}

    #adTitle::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 60px;
        height: 3px;
        background: linear-gradient(90deg, transparent 0%, #0088CC 50%, transparent 100%);
        border-radius: 2px;
    }

#adText {
    color: #2c3e50;
    font-size: 0.95rem;
    line-height: 1.7;
    margin-top: 0;
    text-align: center;
    padding: 14px 16px;
    background-color: rgba(0, 136, 204, 0.06);
    border-radius: 10px;
    border-right: 3px solid #0088CC;
    flex-shrink: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* شارة الخصم في الإعلان */
.ad-discount-badge {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ff8c5a 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
    margin: 8px auto;
    box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

/* زر الإعلان */
.ad-action-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    margin-top: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 136, 204, 0.2);
}

    .ad-action-btn:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 136, 204, 0.3);
        color: white;
    }

/* Responsive Design - Mobile First Approach */
@media (max-width: 767.98px) {
    /* Product Details Mobile */
    .product-title {
        font-size: 1.5rem;
        line-height: 1.4;
    }

    .product-details-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .product-description,
    .product-summary {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    /* Ad Container Mobile */
    .advertisement-container {
        min-height: 300px;
        padding: 16px;
        margin-top: 20px;
        margin-bottom: 15px;
    }

    .ad-content-wrapper {
        min-height: 260px;
        gap: 12px;
    }

    #adTitle {
        font-size: 1.1rem;
        padding-bottom: 10px;
    }

    #adText {
        font-size: 0.85rem;
        padding: 12px;
        line-height: 1.6;
    }

    .ad-media-placeholder {
        margin: 0;
    }

    /* Table Mobile */
    .product-color-selector,
    .product-options-table {
        margin-bottom: 15px;
        padding: 16px;
    }

    .product-options-table {
        padding: 16px 12px;
    }

    .modern-table thead th,
    .modern-table tbody td {
        padding: 10px 6px;
        font-size: 12px;
    }

    .cart-action-btn {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }

    .view-cart-btn {
        min-width: 120px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* Color Selector Mobile */
    .product-color-selector {
        padding: 15px;
    }
}

/* Tablet Design */
@media (min-width: 768px) and (max-width: 991.98px) {
    .product-title {
        font-size: 1.75rem;
    }

    .advertisement-container {
        min-height: 350px;
        padding: 20px;
    }

    .ad-content-wrapper {
        min-height: 300px;
    }

    #adTitle {
        font-size: 1.15rem;
    }

    #adText {
        font-size: 0.9rem;
    }
}

/* Desktop Design */
@media (min-width: 992px) {
    .row.d-flex.align-items-stretch {
        align-items: stretch !important;
    }

    .col-md-5, .col-md-7 {
        display: flex;
        flex-direction: column;
    }

    .advertisement-container {
        flex-grow: 1;
        display: flex !important;
    }

    .product-title {
        font-size: 2rem;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .product-title {
        font-size: 2.25rem;
    }

    .advertisement-container {
        padding: 28px;
    }
}

/* Extra Small Devices */
@media (max-width: 575.98px) {
    .product-title {
        font-size: 1.25rem;
    }

    .product-description,
    .product-summary {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .product-details-link {
        font-size: 0.75rem;
        padding: 0.35rem 0.7rem;
    }

    .advertisement-container {
        padding: 12px;
        min-height: 250px;
        border-radius: 12px;
    }

    .ad-content-wrapper {
        min-height: 220px;
        gap: 10px;
    }

    #adTitle {
        font-size: 1rem;
        padding-bottom: 8px;
    }

    #adText {
        font-size: 0.8rem;
        padding: 10px;
        line-height: 1.5;
    }

    .ad-media-placeholder {
        border-radius: 8px;
    }

    .modern-table {
        font-size: 11px;
    }

        .modern-table thead th,
        .modern-table tbody td {
            padding: 8px 4px;
            font-size: 11px;
        }

    .product-options-table {
        padding: 12px 8px;
    }
}

/* Landscape Mobile */
@media (max-width: 767.98px) and (orientation: landscape) {
    .advertisement-container {
        min-height: 280px;
    }

    .ad-content-wrapper {
        min-height: 240px;
    }
}
