/* Sidebar Widget Styles */
.sidebar-widget {
    max-width: 350px;
    margin: 20px auto;
    padding: 15px;
    background: rgba(16, 16, 32, 0.7);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.2);
    text-align: center;
}

.sidebar-widget h3 {
    color: var(--neon-color);
    margin-top: 0;
    font-size: 1.3rem;
}

.sidebar-widget p {
    color: #ccc;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.amazon-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #00d9ff 0%, #0099cc 100%);
    color: #000;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.amazon-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 217, 255, 0.4);
}

.amazon-link svg {
    transition: transform 0.3s ease;
}

.amazon-link:hover svg {
    transform: translateX(3px);
}

/* Amazon Native Shopping Ads Styles */
.amazon-products-card {
    display: none;
}

.amazon-products-card h3 {
    color: var(--neon-color);
    margin-top: 0;
    text-align: center;
    margin-bottom: 20px;
}

#amzn-assoc-ad-container {
    margin: 0 auto;
    max-width: 100%;
    overflow: hidden;
}

/* Amazon iframe container styles */
.amazon-iframe-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.amazon-disclaimer {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 15px;
}

/* Special styles for Amazon Ubiquiti ad links in sidebar */
#amzn-assoc-ad-sidebar {
    margin: 15px 0;
    font-size: 0.9rem;
    text-align: left;
    max-width: 100%;
    overflow: hidden;
}

/* Remove this min-height that was causing the black space */
/* min-height: 300px; */

#amzn-assoc-ad-sidebar a {
    color: #00d9ff;
    display: block;
    margin-bottom: 8px;
    text-decoration: none;
    border-bottom: 1px dotted rgba(0, 217, 255, 0.2);
    padding-bottom: 5px;
}

#amzn-assoc-ad-sidebar a:hover {
    color: #ffffff;
}

/* These styles will apply to Amazon's injected content */
#amzn-assoc-ad-sidebar .amzn-native-product {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
}

#amzn-assoc-ad-sidebar .amzn-native-product-title a {
    color: #00d9ff;
    text-decoration: none;
}

#amzn-assoc-ad-sidebar .amzn-native-product-title a:hover {
    color: #ffffff;
    text-decoration: underline;
}

#amzn-assoc-ad-sidebar img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 5px 0;
}

/* Fallback Amazon product styles */
.amazon-fallback {
    padding: 10px 0;
}

.amazon-product-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.amazon-product {
    padding: 8px;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.amazon-product:hover {
    background: rgba(0, 217, 255, 0.2);
}

.amazon-product a {
    color: #00d9ff;
    text-decoration: none;
    display: block;
}

.amazon-product a:hover {
    color: #fff;
}

/* General Amazon link styling */
#amzn-assoc-ad-sidebar a {
    color: #00d9ff;
    display: block;
    margin-bottom: 8px;
    text-decoration: none;
    padding: 8px;
    border-bottom: 1px solid rgba(0, 217, 255, 0.2);
    transition: all 0.3s ease;
}

#amzn-assoc-ad-sidebar a:hover {
    color: #ffffff;
    background: rgba(0, 217, 255, 0.1);
}

/* Responsive design */
@media (min-width: 768px) {
    .container {
        display: grid;
        grid-template-columns: 1fr 350px;
        grid-gap: 20px;
    }
    
    .main-card {
        grid-column: 1 / 2;
    }
    
    .sidebar-widget {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        align-self: start;
        position: sticky;
        top: 20px;
    }
    
    .history-card, 
    .features-card,
    .amazon-products-card {
        grid-column: 1 / 2;
    }
    
    .amazon-products-card {
        grid-column: 1 / 3;
    }
}

@media (max-width: 767px) {
    .sidebar-widget {
        order: 2;
    }
}
