/* ============================================
   CUSTOM HTML MODULE WRAPPER
   ============================================ */

[data-module-type="custom_html"] {
    width: 100%;
}

[data-module-type="custom_html"] .module-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

html[data-bs-theme="dark"] [data-module-type="custom_html"] .module-title {
    color: var(--text-color);
    border-bottom-color: #667eea;
}

/* ============================================
   CUSTOM HTML MODULE CONTENT
   ============================================ */

[data-module-type="custom_html"] img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

[data-module-type="custom_html"] a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

[data-module-type="custom_html"] a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

[data-module-type="custom_html"] table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

[data-module-type="custom_html"] table th,
[data-module-type="custom_html"] table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

[data-module-type="custom_html"] table th {
    background-color: var(--bg-color);
    font-weight: 600;
    color: var(--text-color);
}

[data-module-type="custom_html"] table tr:hover td {
    background-color: rgba(102, 126, 234, 0.05);
}

html[data-bs-theme="dark"] [data-module-type="custom_html"] table th {
    background-color: #242830;
}

[data-module-type="custom_html"] blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background-color: var(--bg-color);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-muted);
}

html[data-bs-theme="dark"] [data-module-type="custom_html"] blockquote {
    background-color: #1a1d23;
}

/* ============================================
   CUSTOM TAG STYLES
   ============================================ */

[data-module-type="custom_html"] .custom-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 1rem;
}

[data-module-type="custom_html"] .custom-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

[data-module-type="custom_html"] .custom-link-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

[data-module-type="custom_html"] .custom-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   MODULE WRAPPER (Position context)
   ============================================ */

.module-wrapper [data-module-type="custom_html"] {
    margin-bottom: 0;
}

/* Show title styling for custom_html modules */
.module-wrapper.show-title [data-module-type="custom_html"] .module-title {
    display: block;
}

.module-wrapper:not(.show-title) [data-module-type="custom_html"] .module-title {
    display: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 767px) {
    [data-module-type="custom_html"] .module-title {
        font-size: 1.1rem;
    }

    [data-module-type="custom_html"] table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 575px) {
    [data-module-type="custom_html"] .module-title {
        font-size: 1rem;
    }
}
