/**
 * Dayboro Ad Space Manager - Optimized Split Layout Styles
 */

/* Reset WordPress image defaults */
.dayboro-ad-container img {
    height: auto !important;
    width: auto !important;
    max-width: none !important;
}

/* Base container - precise sizing */
.dayboro-ad-container {
    position: relative;
    display: inline-block;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.dayboro-ad-container:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* Split layout structure */
.daspm-split-layout {
    cursor: pointer;
}

.daspm-ad-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.daspm-ad-content {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

/* Logo section - automatic sizing */
.daspm-logo-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    overflow: hidden;
    background: #f8f8f8;
    border-radius: 4px;
}

.daspm-logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
}

.daspm-logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    color: #999;
}

.daspm-logo-placeholder .dashicons {
    font-size: 48px;
}

/* Business info section */
.daspm-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.daspm-business-name {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.daspm-description {
    margin: 0 0 8px 0;
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.daspm-contact-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.daspm-contact-item {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #555;
}

.daspm-contact-item .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-right: 5px;
    color: #0073aa;
}

.daspm-website {
    color: #0073aa;
    font-weight: 500;
}

/* CTA Overlay */
.daspm-cta-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 115, 170, 0.9);
    color: white;
    padding: 5px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.daspm-ad-link:hover .daspm-cta-overlay {
    transform: translateY(0);
}

.daspm-cta-text {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Special styling when it's a call CTA */
.daspm-split-layout[data-website=""] .daspm-cta-overlay,
.daspm-split-layout[data-website="#"] .daspm-cta-overlay {
    background: rgba(220, 53, 69, 0.9);
}

.daspm-split-layout[data-website=""] .daspm-cta-overlay .dashicons,
.daspm-split-layout[data-website="#"] .daspm-cta-overlay .dashicons {
    font-size: 14px;
    vertical-align: middle;
    margin-right: 3px;
}

/* Size-specific layouts */

/* Leaderboard 728x90 - Horizontal layout */
.dayboro-ad-leaderboard .daspm-logo-section {
    width: 90px;
    height: 70px;
}

.dayboro-ad-leaderboard .daspm-business-name {
    font-size: 18px;
}

.dayboro-ad-leaderboard .daspm-contact-info {
    flex-direction: row;
    gap: 15px;
}

/* Medium Rectangle 300x250 - Balanced layout */
.dayboro-ad-medium-rectangle {
    display: block;
}

.dayboro-ad-medium-rectangle .daspm-logo-section {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    align-self: center;
}

.dayboro-ad-medium-rectangle .daspm-ad-content {
    padding: 15px;
}

.dayboro-ad-medium-rectangle .daspm-business-name {
    font-size: 16px;
    margin-bottom: 8px;
}

.dayboro-ad-medium-rectangle .daspm-info-section {
    justify-content: center;
}

/* Large Rectangle 336x280 - Similar to medium */
.dayboro-ad-large-rectangle .daspm-logo-section {
    width: 120px;
    height: 120px;
    align-self: center;
}

.dayboro-ad-large-rectangle .daspm-ad-content {
    padding: 15px;
}

.dayboro-ad-large-rectangle .daspm-business-name {
    font-size: 18px;
}

.dayboro-ad-large-rectangle .daspm-info-section {
    justify-content: center;
}

/* Wide Skyscraper 160x600 - Vertical layout */
.dayboro-ad-wide-skyscraper .daspm-ad-content {
    flex-direction: column;
    padding: 15px 10px;
}

.dayboro-ad-wide-skyscraper .daspm-logo-section {
    width: 140px;
    height: 140px;
    margin-right: 0;
    margin-bottom: 15px;
}

.dayboro-ad-wide-skyscraper .daspm-info-section {
    text-align: center;
}

.dayboro-ad-wide-skyscraper .daspm-contact-info {
    align-items: center;
}

/* Mobile Banner 320x50 - Minimal layout */
.dayboro-ad-mobile-banner .daspm-logo-section {
    width: 50px;
    height: 40px;
}

.dayboro-ad-mobile-banner .daspm-business-name {
    font-size: 14px;
}

.dayboro-ad-mobile-banner .daspm-contact-item {
    font-size: 11px;
}

.dayboro-ad-mobile-banner .daspm-ad-content {
    padding: 5px;
}

/* Mobile Full Width 320x100 */
.dayboro-ad-mobile-full-width .daspm-logo-section {
    width: 80px;
    height: 80px;
}

.dayboro-ad-mobile-full-width .daspm-business-name {
    font-size: 16px;
}

/* Hero Slider - Special layout */
.dayboro-hero-slider {
    position: relative;
    width: 100%;
    height: 400px;
    overflow: hidden;
}

.dayboro-hero-slider .slider-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.dayboro-hero-slider .slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.dayboro-hero-slider .slider-slide.active {
    opacity: 1;
}

.dayboro-hero-slider .slider-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: #f0f0f0;
    z-index: 1;
}

.dayboro-hero-slider .slider-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.5) 80%, rgba(0,0,0,0.8) 100%);
}

.dayboro-hero-slider .daspm-ad-link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.dayboro-hero-slider .daspm-ad-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    color: white;
    padding: 30px 40px;
    display: flex;
    align-items: center;
    min-height: 120px;
    max-height: 35%;
    box-sizing: border-box;
    z-index: 3;
}

.dayboro-hero-slider .daspm-logo-section {
    width: 100px;
    height: 100px;
    margin-right: 30px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.95);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.dayboro-hero-slider .daspm-logo-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    border-radius: 4px;
}

.dayboro-hero-slider .daspm-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dayboro-hero-slider .daspm-business-name {
    font-size: 36px;
    font-weight: 700;
    color: white;
    margin: 0 0 10px 0;
    white-space: normal;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}

.dayboro-hero-slider .daspm-description {
    font-size: 18px;
    color: rgba(255,255,255,0.95);
    -webkit-line-clamp: 2;
    margin: 0 0 15px 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1.4;
}

.dayboro-hero-slider .daspm-contact-info {
    flex-direction: row;
    gap: 20px;
}

.dayboro-hero-slider .daspm-contact-item {
    color: rgba(255,255,255,0.9);
    font-size: 16px;
}

.dayboro-hero-slider .daspm-contact-item .dashicons {
    color: white;
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.dayboro-hero-slider .daspm-call-cta {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.dayboro-hero-slider .daspm-call-cta:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}

/* Slider navigation */
.dayboro-hero-slider .slider-navigation {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    pointer-events: none;
}

.dayboro-hero-slider .slider-navigation button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    pointer-events: all;
    transition: all 0.3s;
}

.dayboro-hero-slider .slider-navigation button:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

.dayboro-hero-slider .slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dayboro-hero-slider .slider-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.dayboro-hero-slider .slider-dots .dot.active {
    background: white;
    transform: scale(1.2);
}

/* Native Content - Card style */
.dayboro-native-ads {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.native-ad-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.native-ad-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.native-ad-item .native-ad-content {
    padding: 15px;
}

.native-ad-item .native-ad-thumbnail {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

.native-ad-item .native-ad-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.native-ad-item h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.native-ad-item .business-name {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.native-ad-item .description {
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.native-ad-item .native-ad-link {
    display: inline-block;
    padding: 8px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.native-ad-item .native-ad-link:hover {
    background: #005177;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dayboro-ad-desktop-only {
        display: none !important;
    }
    
    /* Adjust hero slider for mobile */
    .dayboro-hero-slider {
        height: 300px;
    }
    
    .dayboro-hero-slider .daspm-ad-content {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .dayboro-hero-slider .daspm-logo-section {
        width: 60px;
        height: 60px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .dayboro-hero-slider .daspm-business-name {
        font-size: 24px;
    }
    
    .dayboro-hero-slider .daspm-description {
        font-size: 14px;
        -webkit-line-clamp: 2;
    }
    
    .dayboro-hero-slider .daspm-contact-info {
        flex-wrap: wrap;
        gap: 10px;
    }
}

@media (min-width: 769px) {
    .dayboro-ad-mobile-only {
        /* Commented out to allow mobile ads to show on desktop for testing */
        /* display: none !important; */
        opacity: 0.7;
        border: 2px dashed #999;
        position: relative;
    }
    
    .dayboro-ad-mobile-only::before {
        content: "Mobile Ad Preview";
        position: absolute;
        top: -20px;
        left: 0;
        font-size: 12px;
        color: #666;
        background: #fff;
        padding: 2px 5px;
    }
}

/* Performance optimizations */
.daspm-logo-img {
    will-change: transform;
}

.dayboro-ad-container {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading states */
.daspm-ad-loading {
    background: #f5f5f5;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Print styles */
@media print {
    .dayboro-ad-container {
        display: none !important;
    }
}

/* Modal Styles */
.daspm-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.daspm-modal-content {
    background-color: #ffffff;
    padding: 0;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.daspm-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #999;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
    background: rgba(0,0,0,0.05);
    z-index: 10;
}

.daspm-modal-close:hover {
    color: #333;
    background: rgba(0,0,0,0.1);
    transform: rotate(90deg);
}

.daspm-modal-body {
    padding: 40px;
}

/* Modal Ad Details Styling */
.daspm-ad-details {
    text-align: center;
}

.daspm-ad-details h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #333;
}

.daspm-ad-details h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #666;
    font-weight: normal;
}

.daspm-ad-details .ad-image {
    margin: 30px 0;
}

.daspm-ad-details .ad-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.daspm-ad-details .ad-description {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.daspm-ad-details .ad-description p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

.daspm-ad-details .ad-contact-info {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 30px;
    margin-top: 30px;
}

.daspm-ad-details .ad-contact-info h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

.daspm-ad-details .ad-contact-info p {
    margin: 15px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.daspm-ad-details .ad-contact-info strong {
    color: #333;
    min-width: 80px;
    text-align: right;
}

.daspm-ad-details .ad-contact-info a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

.daspm-ad-details .ad-contact-info a:hover {
    text-decoration: underline;
}