/**
 * RPR Webinar Widget Builder Styles
 */

/* ============================================
   BUILDER LAYOUT
   ============================================ */

.rpr-widget-builder {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.rpr-builder-header {
    text-align: center;
    margin-bottom: 30px;
}

.rpr-builder-header h2 {
    font-size: 28px;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.rpr-builder-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.rpr-builder-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .rpr-builder-container {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CONFIGURATION PANEL
   ============================================ */

.rpr-builder-config {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.rpr-config-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e0e0e0;
}

.rpr-config-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.rpr-config-section h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    margin: 0 0 16px 0;
}

.rpr-config-field {
    margin-bottom: 16px;
}

.rpr-config-field:last-child {
    margin-bottom: 0;
}

.rpr-config-field > label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.rpr-config-field select,
.rpr-config-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rpr-config-field select:focus,
.rpr-config-field input[type="text"]:focus {
    outline: none;
    border-color: #0070C1;
    box-shadow: 0 0 0 3px rgba(0, 112, 193, 0.15);
}

.rpr-config-field input[type="range"] {
    width: 100%;
    margin-top: 4px;
}

.rpr-count-display {
    display: inline-block;
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.rpr-field-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* Checkbox Group */
.rpr-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rpr-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.rpr-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0070C1;
}

/* Color Inputs */
.rpr-color-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 450px) {
    .rpr-color-grid {
        grid-template-columns: 1fr;
    }
}

.rpr-color-input {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rpr-color-input input[type="color"] {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    cursor: pointer;
    background: #fff;
}

.rpr-color-input input[type="text"] {
    flex: 1;
    min-width: 0;
    padding: 8px;
    font-family: monospace;
    font-size: 12px;
}

/* Color Presets */
.rpr-preset-colors {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #d0d0d0;
}

.rpr-preset-colors span {
    font-size: 12px;
    color: #666;
}

.rpr-preset {
    width: 28px;
    height: 28px;
    padding: 3px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.rpr-preset:hover {
    border-color: #999;
    transform: scale(1.1);
}

.rpr-preset span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

/* Action Buttons */
.rpr-config-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* ============================================
   BUTTONS
   ============================================ */

.rpr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.rpr-btn:active {
    transform: scale(0.98);
}

.rpr-btn-primary {
    background: #0070C1;
    color: #fff;
}

.rpr-btn-primary:hover {
    background: #0062A8;
}

.rpr-btn-secondary {
    background: #fff;
    color: #333;
    border: 1px solid #d0d0d0;
}

.rpr-btn-secondary:hover {
    background: #f5f5f5;
}

.rpr-btn-text {
    background: transparent;
    color: #666;
    padding: 10px 12px;
}

.rpr-btn-text:hover {
    color: #333;
    background: rgba(0,0,0,0.05);
}

/* ============================================
   PREVIEW PANEL
   ============================================ */

.rpr-builder-preview {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.rpr-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.rpr-preview-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.rpr-preview-device-toggle {
    display: flex;
    gap: 4px;
    background: #e0e0e0;
    padding: 3px;
    border-radius: 6px;
}

.rpr-device-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.rpr-device-btn:hover {
    color: #333;
}

.rpr-device-btn.active {
    background: #fff;
    color: #0070C1;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.rpr-preview-frame {
    padding: 20px;
    min-height: 400px;
    display: flex;
    justify-content: center;
    background: #f0f0f0;
    background-image: 
        linear-gradient(45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(-45deg, #e8e8e8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e8e8e8 75%),
        linear-gradient(-45deg, transparent 75%, #e8e8e8 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.rpr-preview-frame[data-device="desktop"] .rpr-preview-content {
    width: 100%;
    max-width: 500px;
}

.rpr-preview-frame[data-device="tablet"] .rpr-preview-content {
    width: 380px;
}

.rpr-preview-frame[data-device="mobile"] .rpr-preview-content {
    width: 300px;
}

.rpr-preview-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: width 0.3s ease;
}

.rpr-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #888;
}

.rpr-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: #0070C1;
    border-radius: 50%;
    animation: rpr-spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

/* ============================================
   EMBED CODE SECTION
   ============================================ */

.rpr-embed-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.rpr-embed-section h3 {
    font-size: 20px;
    color: #1a1a1a;
    margin: 0 0 8px 0;
}

.rpr-embed-section > p {
    color: #666;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.rpr-embed-code-container {
    background: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
}

.rpr-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #2d2d2d;
    border-bottom: 1px solid #3d3d3d;
}

.rpr-code-header span {
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

.rpr-code-header .rpr-btn-primary {
    padding: 8px 14px;
    font-size: 13px;
}

.rpr-embed-code {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

.rpr-embed-code code {
    display: block;
    color: #e0e0e0;
    font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.rpr-embed-tips {
    margin-top: 20px;
    padding: 16px;
    background: #e8f4fd;
    border-radius: 8px;
    border-left: 4px solid #0070C1;
}

.rpr-embed-tips h4 {
    font-size: 14px;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.rpr-embed-tips ul {
    margin: 0;
    padding-left: 20px;
}

.rpr-embed-tips li {
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.rpr-embed-tips li:last-child {
    margin-bottom: 0;
}

/* ============================================
   WEBINAR DISPLAY STYLES (for preview)
   ============================================ */

.rpr-webinars {
    padding: 15px;
}

/* List View */
.rpr-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rpr-list-item {
    border-bottom: 2px dashed var(--rpr-primary, #0070C1);
    padding: 12px 0;
}

.rpr-list-item:last-child {
    border-bottom: none;
}

.rpr-list-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.rpr-list-item a:hover {
    opacity: 0.8;
}

.rpr-date-block {
    flex-shrink: 0;
    background: var(--rpr-primary, #0070C1);
    padding: 8px;
    text-align: center;
    min-width: 60px;
    border-radius: 4px;
}

.rpr-day-of-week {
    background: var(--rpr-accent, #F5F7FA);
    color: #000;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    margin-bottom: 4px;
    border-radius: 2px;
}

.rpr-date-main {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.rpr-event-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--rpr-text, #2B2B2B);
    line-height: 1.4;
}

/* Grid View */
.rpr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    padding: 0;
    margin: 0;
}

.rpr-grid-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s;
}

.rpr-grid-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.rpr-date-badge {
    background: var(--rpr-primary, #0070C1);
    color: #fff;
    padding: 10px;
    text-align: center;
}

.rpr-date-badge .rpr-day-of-week {
    display: block;
    background: var(--rpr-accent, #F5F7FA);
    color: #000;
    font-size: 11px;
    margin: -10px -10px 6px -10px;
    padding: 4px;
}

.rpr-date-badge .rpr-month {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.9;
}

.rpr-date-badge .rpr-day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
}

.rpr-grid-item .rpr-title {
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rpr-text, #2B2B2B);
    margin: 0;
}

/* Compact View */
.rpr-compact-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rpr-compact-list li {
    border-bottom: 1px solid #e0e0e0;
}

.rpr-compact-list li:last-child {
    border-bottom: none;
}

.rpr-compact-list a {
    display: flex;
    align-items: center;
    padding: 10px 4px;
    gap: 10px;
    text-decoration: none;
    transition: background 0.2s;
}

.rpr-compact-list a:hover {
    background: var(--rpr-accent, #F5F7FA);
}

.rpr-compact-date {
    flex-shrink: 0;
    background: var(--rpr-primary, #0070C1);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 3px;
    min-width: 56px;
    text-align: center;
}

.rpr-compact-title {
    font-weight: 500;
    color: var(--rpr-text, #2B2B2B);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* View All Button */
.rpr-view-all {
    margin-top: 16px;
    text-align: right;
}

.rpr-view-all a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--rpr-primary, #0070C1);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: opacity 0.2s;
}

.rpr-view-all a:hover {
    opacity: 0.7;
}

.rpr-view-all svg {
    transition: transform 0.2s;
}

.rpr-view-all a:hover svg {
    transform: translateX(3px);
}

/* No Events */
.rpr-no-events {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.rpr-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1a1a1a;
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.rpr-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.rpr-toast.success {
    background: #00875A;
}
