/* Styles for Video Manager Plus Ads */
.vmp-ads-page .vmp-page-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 25px;
    color: #1e293b;
}

.vmp-ads-page .vmp-page-title .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #4F46E5;
}

.vmp-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.vmp-stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    color: #fff;
}

.vmp-stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.vmp-stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.vmp-stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.vmp-stat-card.vmp-stat-highlight {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.vmp-stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vmp-stat-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: #fff;
}

.vmp-stat-info h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    color: #fff;
}

.vmp-stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

.vmp-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.vmp-admin-header .button-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-size: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
}

.vmp-admin-header .button-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.vmp-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.vmp-filter-select,
.vmp-search-input {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.vmp-filter-select:focus,
.vmp-search-input:focus {
    border-color: #4F46E5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.vmp-search-input {
    min-width: 250px;
}

.vmp-ads-container {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.vmp-ad-item {
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.vmp-ad-item:hover {
    border-color: #4F46E5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.vmp-ad-item.vmp-ad-inactive {
    opacity: 0.6;
    border-color: #cbd5e1;
}

.vmp-ad-preview {
    flex-shrink: 0;
    width: 180px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

.vmp-ad-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vmp-ad-details {
    flex: 1;
}

.vmp-ad-details h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.vmp-ad-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #64748b;
}

.vmp-ad-keywords {
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
}

.vmp-ad-status {
    margin-top: 12px;
}

.vmp-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.vmp-status-badge.vmp-ad-active {
    background: #d1fae5;
    color: #065f46;
}

.vmp-status-badge.vmp-ad-inactive {
    background: #fee2e2;
    color: #991b1b;
}

.vmp-ad-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.vmp-ad-actions .button {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.3s ease;
}

.vmp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.vmp-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 40px;
}

.vmp-modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.vmp-modal-close:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.vmp-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 30px 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.vmp-form-section {
    margin-bottom: 32px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.vmp-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.vmp-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.vmp-form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vmp-form-group.vmp-col-full {
    grid-column: 1 / -1;
}

.vmp-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.vmp-label-required::after {
    content: ' *';
    color: #ef4444;
}

.vmp-input,
.vmp-select,
.vmp-textarea {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.vmp-input:focus,
.vmp-select:focus,
.vmp-textarea:focus {
    border-color: #4F46E5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.vmp-field-description {
    font-size: 12px;
    color: #64748b;
    margin: 4px 0 0 0;
    font-style: italic;
}

.vmp-media-upload-container {
    display: flex;
    gap: 12px;
}

.vmp-media-upload-container .vmp-input {
    flex: 1;
}

.vmp-media-preview {
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.vmp-media-preview img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 300px;
    object-fit: contain;
}

.vmp-range-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vmp-range {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    -webkit-appearance: none;
}

.vmp-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4F46E5;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vmp-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4F46E5;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vmp-range-value {
    font-size: 16px;
    font-weight: 700;
    color: #4F46E5;
    min-width: 50px;
    text-align: center;
}

.vmp-toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.vmp-toggle-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.vmp-toggle-slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: #cbd5e1;
    border-radius: 28px;
    transition: all 0.3s ease;
}

.vmp-toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    top: 3px;
    right: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.vmp-toggle-label input:checked + .vmp-toggle-slider {
    background: #4F46E5;
}

.vmp-toggle-label input:checked + .vmp-toggle-slider::before {
    transform: translateX(-24px);
}

.vmp-toggle-text {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.vmp-form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid #e2e8f0;
}

.vmp-form-actions .button-large {
    padding: 12px 32px;
    font-size: 15px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.vmp-stats-display {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.vmp-stats-display .vmp-stat-item {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
}

.vmp-stats-display .vmp-stat-item:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.vmp-stats-display .vmp-stat-item.vmp-stat-highlight {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.vmp-stat-value {
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    line-height: 1;
}

.vmp-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 30px 0 0 0;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
}

.vmp-page-btn {
    padding: 10px 16px;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    color: #475569;
}

.vmp-page-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.vmp-page-btn.active {
    background: #4F46E5;
    color: #fff;
    border-color: #4F46E5;
}

.vmp-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.vmp-ad-container {
    margin: 30px 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.vmp-ad-container:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.vmp-ad-wrapper {
    position: relative;
    width: 100%;
}

.vmp-ad-label {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 10;
}

.vmp-ad-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.vmp-ad-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.vmp-ad-link:hover .vmp-ad-image {
    transform: scale(1.03);
}

.vmp-video-ad-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.95) !important;
    z-index: 999999 !important;
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
}

.vmp-video-ad-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vmp-video-ad-label {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 193, 7, 0.95);
    color: #000;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    z-index: 999991;
}

.vmp-video-ad-clickable {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 999980;
}

.vmp-video-image-ad {
    max-width: 80% !important;
    max-height: 80% !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

.vmp-video-ad-timer {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    z-index: 999991;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vmp-ad-countdown {
    font-size: 22px;
    color: #ffc107;
    font-weight: 700;
}

.vmp-video-ad-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.95);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    z-index: 999992;
    transition: all 0.3s ease;
    display: none;
}

.vmp-video-ad-close:hover {
    background: #fff;
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .vmp-dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .vmp-admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vmp-ad-item {
        flex-direction: column;
    }
    
    .vmp-ad-preview {
        width: 100%;
    }
}

/* Fallback for missing images */
.vmp-ad-preview-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #94a3b8;
    gap: 8px;
}

.vmp-ad-preview-fallback .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    opacity: 0.5;
}

.vmp-ad-preview-fallback p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.vmp-ad-preview img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
