/* ProStackAI Widget Network - Frontend Styles */

.psawn-widget-container {
    position: relative;
    margin: 0 auto;
    overflow: hidden;
}

/* Vertical Mode (Sidebar) */
.psawn-widget-container.psawn-mode-vertical {
    max-width: 300px;
}

.psawn-widget-container.psawn-mode-vertical .psawn-ads-wrapper {
    position: relative;
    width: 300px;
    height: 250px;
}

/* Horizontal Mode (Header/Footer) */
.psawn-widget-container.psawn-mode-horizontal {
    max-width: 100%;
    text-align: center;
}

.psawn-widget-container.psawn-mode-horizontal .psawn-ads-wrapper {
    display: inline-block;
    position: relative;
    width: 300px;
    height: 250px;
}

/* Inline Mode (Content) */
.psawn-widget-container.psawn-mode-inline {
    max-width: 300px;
    margin: 20px auto;
}

.psawn-widget-container.psawn-mode-inline .psawn-ads-wrapper {
    position: relative;
    width: 300px;
    height: 250px;
}

/* Ad Items */
.psawn-ad-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.psawn-ad-item.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
}

.psawn-ad-item a {
    display: block;
    text-decoration: none;
}

.psawn-ad-item img {
    display: block;
    width: 300px;
    height: 250px;
    border: none;
    border-radius: 4px;
}

.psawn-ad-title {
    display: none; /* Hidden by default; can be enabled if needed */
    padding: 5px;
    font-size: 12px;
    text-align: center;
    background: rgba(0,0,0,0.05);
}

/* Navigation Dots */
.psawn-navigation {
    text-align: center;
    padding: 10px 0;
}

.psawn-nav-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 4px;
    background: #ccc;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.psawn-nav-dot.active {
    background: #0073aa;
    transform: scale(1.2);
}

.psawn-nav-dot:hover {
    background: #0073aa;
}

/* Badge */
.psawn-badge {
    text-align: center;
    padding: 8px 0;
    font-size: 11px;
}

.psawn-badge a {
    color: #666;
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.psawn-badge a:hover {
    opacity: 1;
}

/* Theme: Light */
.psawn-theme-light {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
}

.psawn-theme-light .psawn-badge a {
    color: #666;
}

/* Theme: Dark */
.psawn-theme-dark {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px;
}

.psawn-theme-dark .psawn-badge a {
    color: #aaa;
}

.psawn-theme-dark .psawn-nav-dot {
    background: #555;
}

.psawn-theme-dark .psawn-nav-dot.active {
    background: #0085ba;
}

/* Theme: Auto (uses system preference) */
@media (prefers-color-scheme: dark) {
    .psawn-theme-auto {
        background: #1e1e1e;
        border: 1px solid #333;
    }
    
    .psawn-theme-auto .psawn-badge a {
        color: #aaa;
    }
    
    .psawn-theme-auto .psawn-nav-dot {
        background: #555;
    }
    
    .psawn-theme-auto .psawn-nav-dot.active {
        background: #0085ba;
    }
}

/* Placeholder */
.psawn-placeholder {
    max-width: 300px;
    margin: 0 auto;
    background: #f0f0f0;
    border: 2px dashed #ccc;
    border-radius: 6px;
    padding: 30px 20px;
    text-align: center;
}

.psawn-placeholder-content h4 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #333;
}

.psawn-placeholder-content p {
    margin: 0 0 15px;
    font-size: 14px;
    color: #666;
}

.psawn-placeholder-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s;
}

.psawn-placeholder-button:hover {
    background: #005a87;
}

/* Responsive */
@media (max-width: 320px) {
    .psawn-widget-container.psawn-mode-vertical,
    .psawn-widget-container.psawn-mode-inline {
        max-width: 260px;
    }
    
    .psawn-widget-container.psawn-mode-vertical .psawn-ads-wrapper,
    .psawn-widget-container.psawn-mode-inline .psawn-ads-wrapper {
        width: 260px;
        height: 217px; /* Maintain aspect ratio */
    }
    
    .psawn-ad-item img {
        width: 260px;
        height: 217px;
    }
}
