/* Ad Management Styles */

/* Ad Management Section */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.ad-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.ad-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.ad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.ad-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f2937;
}

.ad-status .status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: #dcfce7;
    color: #166534;
}

.status-badge.inactive {
    background: #fee2e2;
    color: #991b1b;
}

.ad-preview {
    margin-bottom: 1rem;
}

.ad-content {
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    color: #475569;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-actions {
    display: flex;
    gap: 0.5rem;
}

.ad-actions .btn {
    flex: 1;
    justify-content: center;
}

/* Ad Statistics */
.ad-stats {
    margin-top: 2rem;
}

.ad-stats .card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.ad-stats .card-header {
    padding: 1.5rem 1.5rem 0;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 1.5rem;
}

.ad-stats .card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1f2937;
}

.ad-stats .card-body {
    padding: 0 1.5rem 1.5rem;
}

.ad-stats .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.ad-stats .stat-item {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.ad-stats .stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.ad-stats .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
}

/* Ad Modal Styles */
#adModal .modal-content {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.char-count {
    text-align: right;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.char-count.warning {
    color: #f59e0b;
}

.char-count.danger {
    color: #ef4444;
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* Ad Preview */
.ad-preview-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.ad-preview-box {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
}

.ad-banner {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ad-banner.primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
}

.ad-banner.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.ad-banner.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.ad-banner.info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
}

.ad-text {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Live Ad Styles for Website Pages - Sidebar Design */
.page-ad {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    z-index: 1000;
    animation: slideInSidebar 0.8s ease-out;
}

.page-ad.position-left {
    left: 20px;
}

.page-ad.position-right {
    right: 20px;
}

.ad-banner-live {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ad-banner-live:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    border-color: #d1d5db;
}

.ad-banner-live::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6, #10b981, #f59e0b, #06b6d4);
    border-radius: 12px 12px 0 0;
}

.ad-content {
    color: #374151;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    font-weight: 500;
}

.ad-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.ad-cta:hover {
    color: #1d4ed8;
}

.ad-cta i {
    font-size: 0.75rem;
}

.ad-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ad-close:hover {
    color: #6b7280;
    background: #f3f4f6;
}

/* Different styles for variety */
.ad-banner-live.primary .ad-cta {
    color: #3b82f6;
}

.ad-banner-live.success .ad-cta {
    color: #10b981;
}

.ad-banner-live.warning .ad-cta {
    color: #f59e0b;
}

.ad-banner-live.info .ad-cta {
    color: #06b6d4;
}

/* Animations */
@keyframes slideInSidebar {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

.page-ad.position-right {
    animation: slideInSidebarRight 0.8s ease-out;
}

@keyframes slideInSidebarRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .page-ad {
        width: 250px;
    }
    
    .page-ad.position-left {
        left: 10px;
    }
    
    .page-ad.position-right {
        right: 10px;
    }
}

@media (max-width: 1200px) {
    .page-ad {
        width: 220px;
    }
    
    .ad-banner-live {
        padding: 1.25rem;
    }
    
    .ad-content {
        font-size: 0.875rem;
    }
}

@media (max-width: 768px) {
    .page-ad {
        position: relative;
        top: auto;
        transform: none;
        width: 100%;
        left: auto;
        right: auto;
        margin: 1rem 0;
        padding: 0 1rem;
    }
    
    .ad-banner-live {
        padding: 1rem;
    }
    
    .ad-content {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }
    
    .ads-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .ad-card {
        padding: 1rem;
    }
    
    .ad-actions {
        flex-direction: column;
    }
    
    .ad-stats .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .page-ad {
        margin: 0.5rem 0;
        padding: 0 0.5rem;
    }
    
    .ad-banner-live {
        padding: 0.875rem;
    }
    
    .ad-content {
        font-size: 0.8rem;
    }
}