/**
 * Seshio Shortcodes Stylesheet
 * 
 * Uses mix of CSS variables and direct values
 * Medium specificity for good balance
 * Subtle animations for enhanced UX
 */

/* =============================================================================
   SIMPLE INLINE DISPLAY - Ensures shortcodes work within paragraphs
   ============================================================================= */

/* Basic inline display for shortcodes */

.seshio-button,
.seshio-btn {
    display: inline-block;
    line-height: 1.2;
    margin: 0 0.25em;
}

.seshio-highlight,
.seshio-badge {
    display: inline;
    vertical-align: baseline;
    line-height: inherit;
    margin: 0;
    padding: 2px 4px;
}

/* Block-level elements */
.seshio-callout,
.seshio-quote,
.seshio-expand,
.seshio-toggle,
.seshio-spacer,
.seshio-divider {
    display: block;
    margin: 1em 0;
}



/* =============================================================================
   TEXT FORMATTING
   ============================================================================= */

/* Highlights */
.seshio-highlight {
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    cursor: default;
}

.seshio-highlight.seshio-highlight-purple {
    background-color: rgba(207, 140, 254, 0.3);
    color: var(--seshio-black, #1e1e1e);
}

.seshio-highlight.seshio-highlight-green {
    background-color: rgba(23, 255, 122, 0.3);
    color: var(--seshio-black, #1e1e1e);
}

.seshio-highlight.seshio-highlight-yellow {
    background-color: rgba(255, 235, 87, 0.3);
    color: var(--seshio-black, #1e1e1e);
}

.seshio-highlight.seshio-highlight-blue {
    background-color: rgba(0, 202, 249, 0.3);
    color: var(--seshio-black, #1e1e1e);
}

.seshio-highlight.seshio-highlight-red {
    background-color: rgba(255, 140, 147, 0.3);
    color: var(--seshio-black, #1e1e1e);
}

/* Highlight hover effect */
.seshio-highlight:hover {
    filter: brightness(1.1);
    transform: scale(1.02);
}

/* Badges */
.seshio-badge {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.seshio-badge.seshio-badge-purple {
    background-color: var(--seshio-purple, #CF8CFE);
    color: var(--seshio-white, #f3f2f1);
}

.seshio-badge.seshio-badge-green {
    background-color: var(--seshio-green, #17ff7a);
    color: var(--seshio-black, #1e1e1e);
}

.seshio-badge.seshio-badge-yellow {
    background-color: var(--seshio-yellow, #ffeb57);
    color: var(--seshio-black, #1e1e1e);
}

.seshio-badge.seshio-badge-blue {
    background-color: var(--seshio-blue, #00caf9);
    color: var(--seshio-white, #f3f2f1);
}

.seshio-badge.seshio-badge-red {
    background-color: var(--seshio-red, #ff8c93);
    color: var(--seshio-white, #f3f2f1);
}

/* =============================================================================
   CONTENT BLOCKS
   ============================================================================= */

/* Callout Boxes */
.seshio-callout {
    padding: 20px 25px;
    margin: 20px 0;
    border-radius: 12px;
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seshio-callout.seshio-callout-info {
    background-color: rgba(0, 202, 249, 0.1);
    border-left-color: var(--seshio-blue, #00caf9);
}

.seshio-callout.seshio-callout-success {
    background-color: rgba(23, 255, 122, 0.1);
    border-left-color: var(--seshio-green, #17ff7a);
}

.seshio-callout.seshio-callout-warning {
    background-color: rgba(255, 235, 87, 0.1);
    border-left-color: var(--seshio-yellow, #ffeb57);
}

.seshio-callout.seshio-callout-danger {
    background-color: rgba(255, 140, 147, 0.1);
    border-left-color: var(--seshio-red, #ff8c93);
}

/* Callout hover effect */
.seshio-callout:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Remove default paragraph margins inside callouts */
.seshio-callout p:first-child {
    margin-top: 0;
}

.seshio-callout p:last-child {
    margin-bottom: 0;
}

/* Quotes */
.seshio-quote {
    position: relative;
    padding: 20px 30px;
    margin: 30px 0;
    font-style: italic;
    border-left: 4px solid var(--seshio-purple, #CF8CFE);
    background-color: rgba(207, 140, 254, 0.05);
    transition: background-color 0.3s ease;
}

.seshio-quote.seshio-quote-pull {
    font-size: 1.25em;
    font-weight: bold;
    text-align: center;
    border: none;
    padding: 40px;
    background-color: transparent;
}

.seshio-quote.seshio-quote-pull::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    opacity: 0.1;
    font-family: Georgia, serif;
}

.seshio-quote cite {
    display: block;
    margin-top: 15px;
    font-size: 0.9em;
    font-style: normal;
    opacity: 0.8;
}

/* =============================================================================
   INTERACTIVE ELEMENTS
   ============================================================================= */

/* Buttons */
.seshio-button {
    display: inline-block;
    padding: 12px 28px;
    font-weight: bold;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 25px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Button sizes */
.seshio-button.seshio-button-small {
    padding: 8px 20px;
    font-size: 0.875rem;
}

.seshio-button.seshio-button-large {
    padding: 16px 36px;
    font-size: 1.125rem;
}

/* Button colors */
.seshio-button.seshio-button-purple {
    background-color: var(--seshio-purple, #CF8CFE);
    color: var(--seshio-white, #f3f2f1);
}

.seshio-button.seshio-button-purple:hover {
    background-color: transparent;
    color: var(--seshio-purple, #CF8CFE);
    border-color: var(--seshio-purple, #CF8CFE);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(207, 140, 254, 0.3);
}

.seshio-button.seshio-button-green {
    background-color: var(--seshio-green, #17ff7a);
    color: var(--seshio-black, #1e1e1e);
}

.seshio-button.seshio-button-green:hover {
    background-color: transparent;
    color: var(--seshio-green, #17ff7a);
    border-color: var(--seshio-green, #17ff7a);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(23, 255, 122, 0.3);
}

.seshio-button.seshio-button-blue {
    background-color: var(--seshio-blue, #00caf9);
    color: var(--seshio-white, #f3f2f1);
}

.seshio-button.seshio-button-blue:hover {
    background-color: transparent;
    color: var(--seshio-blue, #00caf9);
    border-color: var(--seshio-blue, #00caf9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 202, 249, 0.3);
}

/* Expand/Collapse */
.seshio-expand {
    margin: 20px 0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.seshio-expand-toggle {
    width: 100%;
    padding: 15px 20px;
    background-color: var(--seshio-grey, #ede6e1);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.seshio-expand-toggle:hover {
    background-color: rgba(237, 230, 225, 0.8);
}

.seshio-expand-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
    transition: transform 0.3s ease;
}

.seshio-expand-icon::before,
.seshio-expand-icon::after {
    content: '';
    position: absolute;
    background-color: var(--seshio-black, #1e1e1e);
    transition: all 0.3s ease;
}

.seshio-expand-icon::before {
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    transform: translateY(-50%);
}

.seshio-expand-icon::after {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
}

.seshio-expand-open .seshio-expand-icon {
    transform: rotate(180deg);
}

.seshio-expand-open .seshio-expand-icon::after {
    opacity: 0;
}

.seshio-expand-content {
    padding: 20px;
    background-color: var(--seshio-white, #f3f2f1);
}

/* Toggle */
.seshio-toggle {
    margin: 20px 0;
}

.seshio-toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: bold;
}

.seshio-toggle-checkbox {
    position: relative;
    width: 50px;
    height: 26px;
    appearance: none;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 26px;
    margin-right: 15px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.seshio-toggle-checkbox::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.seshio-toggle-checkbox:checked {
    background-color: var(--seshio-purple, #CF8CFE);
}

.seshio-toggle-checkbox:checked::after {
    transform: translateX(24px);
}

.seshio-toggle-content {
    display: none;
    margin-top: 15px;
    padding: 20px;
    background-color: rgba(207, 140, 254, 0.05);
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

.seshio-toggle-checkbox:checked ~ .seshio-toggle-content {
    display: block;
}

/* =============================================================================
   MEDIA ELEMENTS - SIMPLIFIED
   ============================================================================= */

/* All media elements - single rule for consistent alignment */
.seshio-media-wrapper,
.seshio-media-wrapper *,
.seshio-media,
.seshio-icon,
.seshio-emoji,
.seshio-lottie,
[id^="seshio-media-lottie-"],
[id*="seshio-media-lottie"] {
    display: inline-block !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Enhanced inline styling for SVG elements */
.seshio-media-wrapper img,
.seshio-media-wrapper svg {
    vertical-align: bottom !important;
    display: inline-block !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* SVG elements inside media */
.seshio-icon svg,
.seshio-lottie svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    display: inline-block !important;
    vertical-align: bottom !important;
}

/* Specific styling for media upload Lottie elements */
[id^="seshio-media-lottie-"] {
    display: inline-block !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
}

[id^="seshio-media-lottie-"] svg {
    display: inline-block !important;
    vertical-align: bottom !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
}

/* Enhanced SVG inline styling for better text flow */
.seshio-media-svg {
    display: inline-block !important;
    vertical-align: bottom !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: inherit !important;
    font-size: inherit !important;
    word-spacing: normal !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-indent: 0 !important;
    text-shadow: none !important;
    text-decoration: none !important;
    position: relative !important;
    max-width: 100% !important; /* Prevent SVG from being too wide */
    max-height: 3em !important; /* Reasonable max height for inline use */
}

/* Ensure SVG doesn't break text flow */
p .seshio-media-svg,
div .seshio-media-svg,
span .seshio-media-svg {
    display: inline-block !important;
    vertical-align: bottom !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Hover effects */
.seshio-icon:hover,
.seshio-emoji:hover {
    transform: scale(1.1);
}

.seshio-emoji:hover {
    transform: scale(1.2);
}

/* Block elements that should remain block */
.seshio-media-wrapper .seshio-callout,
.seshio-media-wrapper .seshio-quote,
.seshio-media-wrapper .seshio-expand,
.seshio-media-wrapper .seshio-toggle,
.seshio-media-wrapper .seshio-spacer,
.seshio-media-wrapper .seshio-divider {
    display: block !important;
    margin: 1em 0 !important;
}

/* Font inheritance for media wrapper */
.seshio-media-wrapper {
    font-size: inherit !important;
    font-family: inherit !important;
}

/* =============================================================================
   LAYOUT ELEMENTS
   ============================================================================= */

/* Spacer */
.seshio-spacer {
    display: block;
    width: 100%;
}

/* Divider */
.seshio-divider {
    border: none;
    height: 1px;
    margin: 30px 0;
    background-color: rgba(0, 0, 0, 0.1);
}

.seshio-divider.seshio-divider-dotted {
    height: 3px;
    background-image: radial-gradient(circle, rgba(0, 0, 0, 0.3) 1px, transparent 1px);
    background-size: 8px 3px;
    background-repeat: repeat-x;
}

.seshio-divider.seshio-divider-thick {
    height: 3px;
    background-color: var(--seshio-purple, #CF8CFE);
}

/* =============================================================================
   ANIMATIONS
   ============================================================================= */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================================================
   RESPONSIVE (Minimal - Inherits from Theme)
   ============================================================================= */

@media (max-width: 768px) {
    /* Reduce padding on mobile */
    .seshio-callout {
        padding: 15px 20px;
    }
    
    .seshio-quote {
        padding: 15px 20px;
    }
    
    /* Stack buttons on mobile */
    .seshio-button {
        display: block;
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }
    
    /* Smaller expand/toggle controls */
    .seshio-expand-toggle,
    .seshio-toggle-label {
        font-size: 0.9rem;
    }
}

/* =============================================================================
   PRINT STYLES
   ============================================================================= */

@media print {
    /* Show expanded content when printing */
    .seshio-expand-content,
    .seshio-toggle-content {
        display: block !important;
    }
    
    /* Hide interactive elements */
    .seshio-expand-toggle,
    .seshio-toggle-checkbox {
        display: none;
    }
    
    /* Remove hover effects */
    .seshio-highlight,
    .seshio-button,
    .seshio-callout {
        transition: none !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* =============================================================================
   ENHANCED INLINE SVG STYLING
   ============================================================================= */

/* Ensure SVG flows naturally with text */
p svg.seshio-media-svg,
div svg.seshio-media-svg,
span svg.seshio-media-svg {
    display: inline-block !important;
    vertical-align: bottom !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative !important;
    top: 0 !important; /* Remove fine-tuning for bottom alignment */
}

/* Override any block display that might interfere */
svg.seshio-media-svg {
    display: inline-block !important;
    float: none !important;
    clear: none !important;
}

/* Ensure text flows around SVG naturally */
p:has(svg.seshio-media-svg),
div:has(svg.seshio-media-svg) {
    line-height: inherit !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}