/**
 * RSL JSON Layout Engine v2.0 - Component Styles
 *
 * Beautiful, modern styles for all v2 content types and presets
 *
 * @version 2.0.0
 * @license MIT
 */

/* ========================================================================
   CARDS
   ======================================================================== */

.rsl-card {
    background: var(--rsl-card-bg, #ffffff);
    border: 1px solid var(--rsl-card-border, #e0e0e0);
    border-radius: var(--rsl-card-radius, 8px);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rsl-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.rsl-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.rsl-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rsl-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--rsl-card-title-color, #1e293b);
}

.rsl-card-subtitle {
    font-size: 0.875rem;
    color: var(--rsl-card-subtitle-color, #64748b);
    margin: 0;
}

.rsl-card-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--rsl-card-text-color, #475569);
    margin: 0;
    flex: 1;
}

.rsl-card-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rsl-primary, #6E7BFF);
    margin: 0.5rem 0;
}

.rsl-card-meta {
    font-size: 0.8125rem;
    color: var(--rsl-card-meta-color, #94a3b8);
}

.rsl-card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--rsl-card-border, #e0e0e0);
    background: var(--rsl-card-footer-bg, #f8fafc);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Card Variants */
.rsl-card.pricing {
    text-align: center;
}

.rsl-card.pricing .rsl-card-price {
    font-size: 3rem;
}

.rsl-card.pricing .rsl-pricing-features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
}

.rsl-card.pricing .rsl-pricing-features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rsl-card-border, #e0e0e0);
}

.rsl-card.pricing .rsl-pricing-features li:last-child {
    border-bottom: none;
}

.rsl-card.testimonial {
    font-style: italic;
}

.rsl-card.testimonial .rsl-card-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 1.5rem auto 0;
}

.rsl-card.team .rsl-card-image {
    height: 250px;
}

/* Dark Mode */
[data-theme="dark"] .rsl-card {
    background: var(--rsl-dark-card-bg, #1e293b);
    border-color: var(--rsl-dark-card-border, #334155);
}

[data-theme="dark"] .rsl-card-title {
    color: var(--rsl-dark-card-title, #f1f5f9);
}

[data-theme="dark"] .rsl-card-text {
    color: var(--rsl-dark-card-text, #cbd5e1);
}

[data-theme="dark"] .rsl-card-footer {
    background: var(--rsl-dark-card-footer-bg, #0f172a);
    border-color: var(--rsl-dark-card-border, #334155);
}

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

.rsl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.rsl-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rsl-btn:active {
    transform: translateY(0);
}

.rsl-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Variants */
.rsl-btn-primary {
    background: var(--rsl-primary, #6E7BFF);
    color: white;
}

.rsl-btn-primary:hover {
    background: var(--rsl-primary-dark, #5a67d8);
}

.rsl-btn-secondary {
    background: var(--rsl-secondary, #64748b);
    color: white;
}

.rsl-btn-secondary:hover {
    background: var(--rsl-secondary-dark, #475569);
}

.rsl-btn-success {
    background: var(--rsl-success, #22c55e);
    color: white;
}

.rsl-btn-danger {
    background: var(--rsl-danger, #ef4444);
    color: white;
}

.rsl-btn-warning {
    background: var(--rsl-warning, #f59e0b);
    color: white;
}

.rsl-btn-info {
    background: var(--rsl-info, #3b82f6);
    color: white;
}

.rsl-btn-light {
    background: #f8fafc;
    color: #1e293b;
    border-color: #e2e8f0;
}

.rsl-btn-dark {
    background: #1e293b;
    color: white;
}

/* Outline Buttons */
.rsl-btn-outline.rsl-btn-primary {
    background: transparent;
    color: var(--rsl-primary, #6E7BFF);
    border-color: var(--rsl-primary, #6E7BFF);
}

.rsl-btn-outline.rsl-btn-primary:hover {
    background: var(--rsl-primary, #6E7BFF);
    color: white;
}

/* Button Sizes */
.rsl-btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.rsl-btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1.125rem;
}

.rsl-btn-block {
    display: flex;
    width: 100%;
}

/* Dark Mode Button Text Colors */
[data-theme="dark"] .rsl-btn-primary,
[data-theme="dark"] .rsl-btn-secondary,
[data-theme="dark"] .rsl-btn-success,
[data-theme="dark"] .rsl-btn-danger,
[data-theme="dark"] .rsl-btn-warning,
[data-theme="dark"] .rsl-btn-info,
[data-theme="dark"] .rsl-btn-dark {
    color: white;
}

[data-theme="dark"] .rsl-btn-outline.rsl-btn-primary:hover,
[data-theme="dark"] .rsl-btn-outline.rsl-btn-secondary:hover,
[data-theme="dark"] .rsl-btn-outline.rsl-btn-success:hover,
[data-theme="dark"] .rsl-btn-outline.rsl-btn-danger:hover,
[data-theme="dark"] .rsl-btn-outline.rsl-btn-warning:hover,
[data-theme="dark"] .rsl-btn-outline.rsl-btn-info:hover {
    color: white;
}

/* ========================================================================
   BADGES
   ======================================================================== */

.rsl-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 4px;
}

.rsl-badge-primary {
    background: var(--rsl-primary, #6E7BFF);
    color: white;
}

.rsl-badge-secondary {
    background: var(--rsl-secondary, #64748b);
    color: white;
}

.rsl-badge-success {
    background: var(--rsl-success, #22c55e);
    color: white;
}

.rsl-badge-danger {
    background: var(--rsl-danger, #ef4444);
    color: white;
}

.rsl-badge-warning {
    background: var(--rsl-warning, #f59e0b);
    color: white;
}

.rsl-badge-info {
    background: var(--rsl-info, #3b82f6);
    color: white;
}

.rsl-badge-pill {
    border-radius: 10rem;
}

/* ========================================================================
   ALERTS
   ======================================================================== */

.rsl-alert {
    position: relative;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
}

.rsl-alert-info {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1e40af;
}

.rsl-alert-success {
    background: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

.rsl-alert-warning {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}

.rsl-alert-danger {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}

.rsl-alert-dismissible {
    padding-right: 3rem;
}

.rsl-alert-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.rsl-alert-close:hover {
    opacity: 1;
}

/* ========================================================================
   HERO
   ======================================================================== */

.rsl-hero {
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--rsl-primary, #6E7BFF) 0%, #764ba2 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.rsl-hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.rsl-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.rsl-hero-subtitle {
    font-size: clamp(1.125rem, 3vw, 1.5rem);
    opacity: 0.95;
    margin: 0 0 1.5rem;
}

.rsl-hero-text {
    font-size: 1.125rem;
    opacity: 0.9;
    margin: 0 0 2rem;
}

.rsl-hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.rsl-hero-image {
    margin-top: 3rem;
}

.rsl-hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Hero Variants */
.rsl-hero.secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.rsl-hero.dark {
    background: #1e293b;
}

.rsl-hero.light {
    background: #f8fafc;
    color: #1e293b;
}

@media (min-width: 768px) {
    .rsl-hero {
        padding: 6rem 2rem;
    }
}

/* Dark Mode Hero Button Text Fix */
[data-theme="dark"] .rsl-hero .rsl-btn {
    color: white !important;
}

/* ========================================================================
   STATS
   ======================================================================== */

.rsl-stat {
    text-align: center;
    padding: 1.5rem;
}

.rsl-stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--rsl-primary, #6E7BFF);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.rsl-stat-label {
    font-size: 0.875rem;
    color: var(--rsl-text-secondary, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

[data-theme="dark"] .rsl-stat-label {
    color: var(--rsl-dark-text-secondary, #94a3b8);
}

/* ========================================================================
   CTA (Call to Action)
   ======================================================================== */

.rsl-cta {
    padding: 4rem 2rem;
    text-align: center;
    background: var(--rsl-primary, #6E7BFF);
    color: white;
    border-radius: 12px;
}

.rsl-cta-content h2 {
    font-size: 2.5rem;
    margin: 0 0 1rem;
}

.rsl-cta-content p {
    font-size: 1.25rem;
    opacity: 0.95;
    margin: 0 0 2rem;
}

.rsl-cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================================================
   TABLE
   ======================================================================== */

.rsl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.rsl-table thead {
    background: var(--rsl-table-header-bg, #f8fafc);
    border-bottom: 2px solid var(--rsl-table-border, #e2e8f0);
}

.rsl-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--rsl-table-header-color, #1e293b);
}

.rsl-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--rsl-table-border, #e2e8f0);
}

.rsl-table tbody tr:hover {
    background: var(--rsl-table-row-hover, #f8fafc);
}

.rsl-table tbody tr:last-child td {
    border-bottom: none;
}

[data-theme="dark"] .rsl-table {
    color: var(--rsl-dark-text-primary, #e2e8f0);
}

[data-theme="dark"] .rsl-table thead {
    background: var(--rsl-dark-bg-secondary, #1e293b);
    border-color: var(--rsl-dark-border, #334155);
}

[data-theme="dark"] .rsl-table td {
    border-color: var(--rsl-dark-border, #334155);
}

[data-theme="dark"] .rsl-table tbody tr:hover {
    background: var(--rsl-dark-bg-tertiary, #0f172a);
}

/* ========================================================================
   UTILITIES
   ======================================================================== */

.rsl-spacer {
    display: block;
    width: 100%;
}

/* Responsive Visibility */
@media (max-width: 479px) {
    .hide-xs { display: none !important; }
}

@media (min-width: 480px) and (max-width: 767px) {
    .hide-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 992px) {
    .hide-md { display: none !important; }
}

@media (min-width: 993px) and (max-width: 1200px) {
    .hide-lg { display: none !important; }
}

@media (min-width: 1201px) and (max-width: 1600px) {
    .hide-xl { display: none !important; }
}

@media (min-width: 1601px) {
    .hide-xxl { display: none !important; }
}

/* Show only on specific breakpoint */
.show-xs-only {
    display: block !important;
}

@media (min-width: 480px) {
    .show-xs-only { display: none !important; }
}

.show-sm-only {
    display: none !important;
}

@media (min-width: 480px) and (max-width: 767px) {
    .show-sm-only { display: block !important; }
}

/* Text Alignment */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }

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

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

.rsl-fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* ========================================================================
   CSS VARIABLES
   ======================================================================== */

:root {
    /* Primary Colors */
    --rsl-primary: #6E7BFF;
    --rsl-primary-dark: #5a67d8;
    --rsl-secondary: #64748b;
    --rsl-secondary-dark: #475569;
    --rsl-success: #22c55e;
    --rsl-danger: #ef4444;
    --rsl-warning: #f59e0b;
    --rsl-info: #3b82f6;

    /* Card Colors */
    --rsl-card-bg: #ffffff;
    --rsl-card-border: #e0e0e0;
    --rsl-card-radius: 8px;
    --rsl-card-title-color: #1e293b;
    --rsl-card-subtitle-color: #64748b;
    --rsl-card-text-color: #475569;
    --rsl-card-meta-color: #94a3b8;
    --rsl-card-footer-bg: #f8fafc;

    /* Table Colors */
    --rsl-table-header-bg: #f8fafc;
    --rsl-table-header-color: #1e293b;
    --rsl-table-border: #e2e8f0;
    --rsl-table-row-hover: #f8fafc;

    /* Text Colors */
    --rsl-text-primary: #1e293b;
    --rsl-text-secondary: #64748b;
}

[data-theme="dark"] {
    /* Dark Mode Card Colors */
    --rsl-dark-card-bg: #1e293b;
    --rsl-dark-card-border: #334155;
    --rsl-dark-card-title: #f1f5f9;
    --rsl-dark-card-text: #cbd5e1;
    --rsl-dark-card-footer-bg: #0f172a;

    /* Dark Mode Backgrounds */
    --rsl-dark-bg-primary: #0f172a;
    --rsl-dark-bg-secondary: #1e293b;
    --rsl-dark-bg-tertiary: #334155;

    /* Dark Mode Borders */
    --rsl-dark-border: #334155;

    /* Dark Mode Text */
    --rsl-dark-text-primary: #f1f5f9;
    --rsl-dark-text-secondary: #94a3b8;
}

/* ============================================================
   Section Radius Utilities
   Use on <section> or wrapper elements in type:"html" blocks.
   The V2 engine applies these automatically via the sectionRadius
   item-config field; these classes let raw HTML sections use the
   same named scale.
   ============================================================ */
.rsl-radius-soft    { border-radius: 24px;  overflow: hidden; }
.rsl-radius-large   { border-radius: 48px;  overflow: hidden; }
.rsl-radius-extreme { border-radius: 96px;  overflow: hidden; }
.rsl-radius-pillow  { border-radius: 999px; overflow: hidden; }
