/* ByzBook Ad System - Unified Styles */
/* ================================== */

/* Ad Container Base Styles */
.ads-container,
.ad-container {
    position: relative;
    margin: 15px 0;
    text-align: center;
    transition: all 0.3s ease;
}

/* Business Profile Ad Enhancements */
.ad-container a {
    text-decoration: none;
    display: block;
    position: relative;
    overflow: hidden;
}

.ad-container a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.ad-container a:hover::before {
    left: 100%;
}

.ad-container img {
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    height: auto;
    display: block;
}

.ad-container img:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.18);
}

/* Business Profile Specific Ad Styling */
.ad-container.ad-header img {
    max-height: 120px;
    object-fit: cover;
    border-radius: 8px;
}

.ad-container.ad-sidebar img {
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.ad-container.ad-footer img {
    max-height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.ads-container .ad-label,
.ad-container .ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(0, 86, 179, 0.9));
    color: white;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 12px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

/* Add Advertisement label to all ad containers */
.ad-container::after {
    content: 'Advertisement';
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.9), rgba(0, 86, 179, 0.9));
    color: white;
    padding: 4px 8px;
    font-size: 9px;
    font-weight: 600;
    border-radius: 12px;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
}

/* Position-Specific Container Styles */
.ad-header,
.ad-container.ad-header {
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.ad-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #007bff, #0056b3);
}

.ad-sidebar,
.ad-container.ad-sidebar {
    margin: 20px 0;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 20px;
    transition: all 0.3s ease;
}

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

.ad-footer,
.ad-container.ad-footer {
    margin: 30px 0 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.ad-footer::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #28a745, #20c997);
}

.ad-content,
.ad-container.ad-content {
    margin: 25px 0;
    padding: 20px 0;
}

.ad-featured {
    margin: 25px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

/* Ad Card Base Styles */
.ad-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
}

.ad-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.ad-card.clickable {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.ad-card.clickable:hover {
    text-decoration: none;
    color: inherit;
}

/* Header Ad Specific Styles */
.ad-header .ad-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-left: 4px solid #007bff;
}

.ad-header .ad-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    flex-shrink: 0;
}

.ad-header .ad-content {
    flex: 1;
    margin: 0;
    padding: 0;
}

.ad-header .ad-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 5px;
    line-height: 1.3;
}

.ad-header .ad-description {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0;
    line-height: 1.4;
}

.ad-header .ad-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-left: 15px;
    flex-shrink: 0;
}

.ad-header .ad-button:hover {
    background: #0056b3;
}

/* Sidebar Ad Specific Styles */
.ad-sidebar .ad-card {
    padding: 15px;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.ad-sidebar .ad-image {
    width: 100%;
    max-width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
}

.ad-sidebar .ad-title {
    font-size: 1rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 8px;
    line-height: 1.3;
}

.ad-sidebar .ad-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 12px;
    line-height: 1.4;
}

.ad-sidebar .ad-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
    width: 100%;
}

.ad-sidebar .ad-button:hover {
    background: #1e7e34;
}

/* Footer Ad Specific Styles */
.ad-footer .ad-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #343a40 0%, #495057 100%);
    color: white;
    border: none;
}

.ad-footer .ad-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
    flex-shrink: 0;
}

.ad-footer .ad-content {
    flex: 1;
    margin: 0;
    padding: 0;
}

.ad-footer .ad-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
    line-height: 1.3;
}

.ad-footer .ad-description {
    font-size: 0.95rem;
    color: #ced4da;
    margin-bottom: 0;
    line-height: 1.4;
}

.ad-footer .ad-button {
    background: #ffc107;
    color: #343a40;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 20px;
    flex-shrink: 0;
}

.ad-footer .ad-button:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

/* Content Ad Specific Styles */
.ad-content .ad-card {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
    border-left: 4px solid #2196f3;
}

.ad-content .ad-image {
    width: 100px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 20px;
    flex-shrink: 0;
}

.ad-content .ad-content-body {
    flex: 1;
    margin: 0;
    padding: 0;
}

.ad-content .ad-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1976d2;
    margin-bottom: 8px;
    line-height: 1.3;
}

.ad-content .ad-description {
    font-size: 0.9rem;
    color: #424242;
    margin-bottom: 0;
    line-height: 1.4;
}

.ad-content .ad-button {
    background: #2196f3;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 5px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
    margin-left: 20px;
    flex-shrink: 0;
}

.ad-content .ad-button:hover {
    background: #1976d2;
}

/* Featured Ad Specific Styles */
.ad-featured .ad-card {
    padding: 25px;
    text-align: center;
    background: linear-gradient(135deg, #fff3e0 0%, #ffffff 100%);
    border: 2px solid #ff9800;
    position: relative;
    overflow: hidden;
}

.ad-featured .ad-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff9800 0%, #f57c00 100%);
}

.ad-featured .ad-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    margin: 0 auto 15px;
    border: 3px solid #ff9800;
}

.ad-featured .ad-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e65100;
    margin-bottom: 10px;
    line-height: 1.3;
}

.ad-featured .ad-description {
    font-size: 1rem;
    color: #424242;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ad-featured .ad-button {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(255, 152, 0, 0.3);
}

.ad-featured .ad-button:hover {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 152, 0, 0.4);
}

/* Default Ad Styles */
.ad-default .ad-card {
    padding: 15px;
    background: white;
}

.ad-default .ad-image {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    float: left;
    margin-right: 15px;
    margin-bottom: 10px;
}

.ad-default .ad-title {
    font-size: 1rem;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 5px;
    line-height: 1.3;
}

.ad-default .ad-description {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 10px;
    line-height: 1.4;
}

.ad-default .ad-button {
    background: #6c757d;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.ad-default .ad-button:hover {
    background: #545b62;
}

/* Responsive Design */
@media (max-width: 768px) {
    .ad-header .ad-card,
    .ad-content .ad-card,
    .ad-footer .ad-card {
        flex-direction: column;
        text-align: center;
    }
    
    .ad-header .ad-image,
    .ad-content .ad-image,
    .ad-footer .ad-image {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .ad-header .ad-button,
    .ad-content .ad-button,
    .ad-footer .ad-button {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .ad-featured .ad-image {
        width: 100px;
        height: 100px;
    }
    
    .ad-sidebar {
        position: static;
    }
}

@media (max-width: 576px) {
    .ads-container {
        margin: 10px 0;
    }
    
    .ad-header,
    .ad-content,
    .ad-footer {
        padding: 10px 0;
        margin: 15px 0;
    }
    
    .ad-featured {
        padding: 15px;
        margin: 15px 0;
    }
    
    .ad-card {
        margin-bottom: 10px;
    }
    
    .ad-featured .ad-title {
        font-size: 1.1rem;
    }
    
    .ad-featured .ad-description {
        font-size: 0.9rem;
    }
}

/* Animation for ad loading */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ads-container {
    animation: fadeInUp 0.6s ease-out;
}

/* Print styles - hide ads when printing */
@media print {
    .ads-container {
        display: none !important;
    }
}
