/* ABOUTME: Styles for the embeddable Divine video widget */
/* ABOUTME: Supports dark/light themes via data-theme attribute */

/* Theme variables - dark (default) */
:root,
html[data-theme="dark"] {
    --bg: #000000;
    --card-bg: #1A1A1A;
    --text-primary: #FFFFFF;
    --text-secondary: #BBBBBB;
    --accent: #00B488;
    --accent-dark: #009A72;
    --border: #254136;
    --overlay: rgba(0, 0, 0, 0.53);
    --thumb-bg: #111111;
    --play-fill: #FFFFFF;
}

/* Theme variables - light */
html[data-theme="light"] {
    --bg: #FFFFFF;
    --card-bg: #F5F5F5;
    --text-primary: #1A1A1A;
    --text-secondary: #666666;
    --accent: #00B488;
    --accent-dark: #009A72;
    --border: #E1E8ED;
    --overlay: rgba(0, 0, 0, 0.35);
    --thumb-bg: #E0E0E0;
    --play-fill: #FFFFFF;
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Container */
.embed-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Profile header */
.embed-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
}

.embed-profile:hover {
    opacity: 0.85;
}

.embed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card-bg);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
    border: 2px solid var(--border);
}

.embed-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.embed-profile-info {
    flex: 1;
    min-width: 0;
}

.embed-profile-name {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.embed-profile-bio {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Video card */
.embed-video-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.embed-video-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.embed-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: var(--thumb-bg);
    overflow: hidden;
}

.embed-thumb-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.embed-thumb-wrapper .no-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
}

.embed-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--overlay);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.embed-play-overlay svg {
    width: 20px;
    height: 20px;
    fill: #FFFFFF;
    margin-left: 3px;
}

.embed-video-info {
    padding: 10px 12px;
}

.embed-video-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.embed-video-time {
    font-size: 11px;
    color: var(--text-secondary);
}

/* CTA button */
.embed-cta {
    display: block;
    text-align: center;
    background: var(--accent);
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    margin-top: 4px;
    margin-bottom: 12px;
    transition: background 0.2s;
}

.embed-cta:hover {
    background: var(--accent-dark);
    text-decoration: none;
}

/* Footer */
.embed-footer {
    margin-top: auto;
    padding-top: 8px;
    text-align: center;
}

.embed-footer a {
    font-size: 11px;
    color: var(--text-secondary);
    text-decoration: none;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.embed-footer a:hover {
    opacity: 1;
}

/* Loading state */
.embed-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.embed-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error state */
.embed-error {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.5;
}

.embed-error-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

/* Empty state */
.embed-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Hidden utility */
.hidden {
    display: none !important;
}
