/**
 * Oracle Reader Frontend Styles
 * @package AI_Oracle_Reader
 * @since 1.6.0
 */

/* Hide spread preview container - not needed */
#preview-container {
    display: none !important;
}

/* Reading Container */
.aior-reading-container {
    margin: 0 auto;
    padding: 2rem;
    background: transparent; /* Let parent control background */
}

/* If you want a contained version, add class .aior-contained */
.aior-reading-container.aior-contained {
    max-width: 900px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Form Styles */
.oracle-reading-form .form-group {
    margin-bottom: 1.5rem;
}

.oracle-reading-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.oracle-reading-form label .dashicons {
    margin-right: 0.5rem;
    color: #7c3aed;
}

.oracle-reading-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.oracle-reading-form .form-control:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.oracle-reading-form textarea.form-control {
    resize: vertical;
    line-height: 1.5;
}

.oracle-reading-form .description,
.oracle-reading-form p.description {
    font-size: 12px;
    color: #646970;
    margin-top: 0.5rem;
}

/* Card Back Preview */
.card-back-preview {
    margin: 2rem 0;
    padding: 2rem;
    background: #f6f7f7;
    border-radius: 8px;
}

.preview-container {
    position: relative;
    min-height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    padding: 2rem;
}

.card-grid {
    display: grid;
    /* Grid dimensions set by JavaScript based on spread settings */
    gap: 1.5rem;
    max-width: 800px;
    margin: 0 auto;
    min-height: 250px;
    justify-content: center;
    align-content: center;
    justify-items: center;
    align-items: start;
}

/* Small spreads override */
.card-grid[data-card-count="1"],
.card-grid[data-card-count="2"], 
.card-grid[data-card-count="3"] {
    gap: 2rem;
    padding: 1rem;
}

.card-back-item {
    position: relative;
    aspect-ratio: 2/3;
    transition: transform 0.3s ease;
    margin-bottom: 2.5rem; /* Space for label below */
    max-width: 180px;
    width: 100%;
}

.card-back-item:hover {
    transform: scale(1.05);
}

.card-back-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.card-position-label {
    position: absolute;
    bottom: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 180%;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #1d2327;
    text-transform: uppercase;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
    hyphens: auto;
}

/* Submit Button */
.submit-button {
    text-align: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f6f7f7;
    color: #1d2327;
    border: 2px solid #dcdcde;
}

.btn-secondary:hover {
    background: #ffffff;
    border-color: #7c3aed;
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 18px;
}

/* Loading State */
.aior-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7c3aed;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 16px;
    color: #646970;
    font-weight: 500;
}

/* Reading Results */
.reading-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #f6f7f7;
}

.reading-title {
    font-size: 24px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.reading-meta {
    font-size: 14px;
    color: #646970;
}

/* Drawn Cards Display - New flex-wrap layout */
.drawn-cards-container {
    margin: 1rem auto 0;
    max-width: 1200px;
}

/* Cards display with flex wrapping (handles any number of cards) */
.cards-display {
    gap: 20px !important;
    padding: 30px 20px !important;
    margin: 0 auto 1.5rem !important;
    width: 100% !important;
}

/* Flex layout (fallback) */
.cards-display:not(.layout-grid) {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-start !important;
}

/* CSS Grid layout (for spread layouts with explicit row/col positioning) - v3.12 fix */
.cards-display.layout-grid {
    display: grid !important;
    justify-content: center !important;
    align-content: center !important;
    justify-items: center !important;
    align-items: center !important;
    max-width: 1000px !important;
}

/* Oracle card wrapper - compatible with both flex and grid layouts */
.oracle-cards-display .oracle-card-wrapper {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
}

/* Position label (above card - kept for spacing) */
.oracle-card-wrapper .card-position-label {
    text-align: center !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1d2327 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    line-height: 1.4 !important;
    min-height: 28px !important;
    max-width: 200px !important;
    margin-bottom: 12px !important;
}

/* Individual oracle card - FIXED SIZE (v3.13): 140×220px to match Tarot Reader */
.oracle-card-wrapper .oracle-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    position: relative !important;
    
    /* v3.13 FIX: Match Tarot Reader card dimensions (140×220px) */
    width: 140px !important;
    height: 220px !important;
    flex-shrink: 0 !important;
}

/* Card info overlay - positioned label on card (like tarot) */
.oracle-card .card-info-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    padding: 20px 15px !important;
    color: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
    border-radius: 8px !important;
    z-index: 10 !important;
}

.oracle-card:hover .card-info-overlay {
    opacity: 1 !important;
}

.oracle-card .card-info-overlay h4 {
    margin: 0 0 8px 0 !important;
    font-size: 14px !important;
    text-transform: uppercase !important;
    color: #a78bfa !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px !important;
}

/* Card name in overlay */
.oracle-card .card-info-overlay .card-name {
    margin: 0 0 6px 0 !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    color: #fff !important;
    text-align: center !important;
    word-wrap: break-word !important;
    max-width: 240px !important;
}

/* Orientation (Upright/Reversed) in overlay */
.oracle-card .card-info-overlay .card-orientation {
    margin: 0 !important;
    font-size: 13px !important;
    font-style: italic !important;
    color: #d1d5db !important;
    text-align: center !important;
}

/* Card image - v3.13 FIX: Reduced from 280×420 to 140×220 to match Tarot Reader */
.oracle-card .card-image {
    width: 140px !important;
    height: 220px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    background: #fff !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.oracle-card .card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
}

/* Reversed card rotation */
.oracle-card .card-image.reversed img {
    transform: rotate(180deg) !important;
}

/* Card image hover effect */
.oracle-card .card-image:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.3) !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

/* Card name is now in overlay - this rule removed */

/* Card orientation is now in overlay - old rules removed */

/* Interpretation */
.reading-interpretation {
    margin: 0 0 3rem 0;
    padding: 2rem;
    background: #f6f7f7;
    border-radius: 12px;
}

.reading-interpretation h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #1d2327;
}

.interpretation-content {
    line-height: 1.8;
    color: #1d2327;
    font-size: 15px;
}

/* Reflection Questions */
.reflection-questions {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left: 4px solid #7c3aed;
    border-radius: 0 12px 12px 0;
}

.reflection-questions h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #7c3aed;
}

.questions-content ul {
    list-style: none;
    padding: 0;
}

.questions-content li {
    padding: 0.75rem 0;
    padding-left: 2rem;
    position: relative;
    line-height: 1.6;
}

.questions-content li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #7c3aed;
    font-weight: bold;
}

/* Action Buttons */
.reading-actions {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f6f7f7;
}

/* Error Display */
.aior-error {
    text-align: center;
    padding: 2rem;
    background: #fee;
    border-radius: 8px;
    border: 2px solid #fcc;
}

.error-message {
    color: #c33;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

/* Checkbox Label */
.checkbox-label {
    display: flex;
    align-items: start;
    gap: 0.75rem;
    font-size: 13px;
    line-height: 1.6;
}

.checkbox-label input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .aior-reading-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .card-grid {
        grid-template-columns: repeat(5, 1fr);
        grid-template-rows: repeat(7, 1fr);
        gap: 0.75rem;
    }
    
    .card-info h4 {
        font-size: 10px;
    }
    
    .card-keywords {
        font-size: 8px;
    }
}

/* Responsive for mobile - smaller cards */
@media (max-width: 768px) {
    .cards-display {
        gap: 16px;
        padding: 20px 16px;
    }
    
    .oracle-card .card-image {
        width: 100px;
        height: 150px;
    }
    
    .oracle-card .card-name {
        max-width: 110px;
        font-size: 12px;
    }
    
    .oracle-card-wrapper .card-position-label {
        max-width: 110px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .cards-display {
        gap: 12px;
        padding: 16px 12px;
    }
    
    .oracle-card .card-image {
        width: 85px;
        height: 128px;
    }
    
    .oracle-card .card-name {
        max-width: 95px;
        font-size: 11px;
        min-height: 22px;
    }
    
    .oracle-card-wrapper .card-position-label {
        max-width: 95px;
        font-size: 10px;
        min-height: 20px;
    }
}

/* Download Button Styling */
.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-success .dashicons {
    color: white;
}

/* ── Bookmark / Share Button ──────────────────────────────────────────────── */
.btn-bookmark {
    background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%);
    color: #fff;
    border: none;
}

.btn-bookmark:hover {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.35);
}

.btn-bookmark .dashicons {
    color: #fff;
}

/* ── Post-login saved confirmation ────────────────────────────────────────── */
.aior-saved-confirmation {
    text-align: center;
    padding: 2rem 1rem;
    color: #9f7aea;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* ── Post-login pending reading notice banner ─────────────────────────────── */
.aior-pending-notice {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-align: center;
    padding: 0.85rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.aior-pending-notice.aior-pending-error {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
}

.aior-pending-notice a {
    color: #fff;
    text-decoration: underline;
}

.aior-pending-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: aiorSpin 0.7s linear infinite;
    flex-shrink: 0;
}

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

/* ── Auth Modal Overlay ───────────────────────────────────────────────────── */
.aior-auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(15, 10, 30, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.aior-auth-modal-box {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 3rem 2.5rem 2.5rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255,255,255,0.08);
    animation: aiorModalIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes aiorModalIn {
    from { opacity: 0; transform: scale(0.88) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}

/* Close button */
.aior-auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    transition: background 0.2s, color 0.2s;
    padding: 0;
}

.aior-auth-modal-close:hover {
    background: #e5e7eb;
    color: #111827;
}

/* Decorative stars */
.aior-auth-modal-stars {
    font-size: 1.1rem;
    letter-spacing: 0.4em;
    color: #9f7aea;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* Icon circle */
.aior-auth-modal-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: #fff;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.35);
}

/* Title */
.aior-auth-modal-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 0.6rem;
    line-height: 1.25;
}

/* Subtitle */
.aior-auth-modal-subtitle {
    font-size: 0.95rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 2rem;
}

/* CTA buttons */
.aior-auth-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.aior-auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.25s ease;
    cursor: pointer;
}

.aior-auth-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.aior-auth-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    color: #fff;
    text-decoration: none;
}

.aior-auth-btn-secondary {
    background: #f9fafb;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.aior-auth-btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9f7aea;
    color: #374151;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ── Inline Share Panel (shown after Bookmark / Share for logged-in users) ── */
.aior-inline-share-panel {
    margin-top: 1.5rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 14px;
    animation: aiorModalIn 0.25s ease both;
}

.aior-inline-share-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.aior-inline-share-label {
    color: #c4b5fd;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0;
}

.aior-inline-share-link-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 480px;
}

.aior-inline-share-url {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #e9d8fd;
    font-size: 0.85rem;
    outline: none;
    min-width: 0;
}

.aior-inline-copy-btn {
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.aior-inline-copy-btn:hover {
    opacity: 0.88;
}

.aior-inline-share-socials {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.aior-inline-social {
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s, transform 0.2s;
}

.aior-inline-social:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.aior-soc-fb { background: #1877f2; }
.aior-soc-tw { background: #000; }
.aior-soc-pi { background: #e60023; }
.aior-soc-em { background: #6b7280; }

/* Mobile tweaks */
@media (max-width: 520px) {
    .aior-auth-modal-box {
        padding: 2.5rem 1.5rem 2rem;
    }
    .aior-auth-modal-title {
        font-size: 1.2rem;
    }
    .aior-inline-share-link-row {
        flex-direction: column;
    }
    .aior-inline-copy-btn {
        width: 100%;
    }
}
/* ================================================================
   UI POLISH - v2.4.0
   Card-style selectors matching Tarot interface
   ================================================================ */

/* Section Labels */
.section-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 16px;
}

.section-label .dashicons {
    color: #6b46c1;
}

/* Reading Type Cards Grid */
.type-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.type-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.type-card:hover {
    border-color: #9f7aea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(107, 70, 193, 0.15);
}

.type-card.selected {
    border-color: #6b46c1;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.2);
}

.type-card.selected::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #6b46c1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.type-card-header h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
}

.type-card-description {
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
}

/* Spread Cards Grid */
.spread-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.spread-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.spread-card:hover {
    border-color: #9f7aea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(107, 70, 193, 0.15);
}

.spread-card.selected {
    border-color: #6b46c1;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.2);
}

.spread-card.selected::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #6b46c1;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.spread-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.spread-card-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

.card-count-badge {
    background: linear-gradient(135deg, #6b46c1 0%, #9f7aea 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.spread-card-description {
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
}

/* Reading Length Options */
.length-options {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.length-option {
    flex: 1;
    min-width: 150px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.length-option:hover {
    border-color: #9f7aea;
    background: #faf5ff;
}

.length-option.selected,
.length-option:has(input:checked) {
    border-color: #6b46c1;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 2px 8px rgba(107, 70, 193, 0.15);
}

.length-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.length-option input[type="radio"]:checked {
    border-color: #6b46c1;
    background: #6b46c1;
}

.length-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.length-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.length-label strong {
    font-size: 15px;
    color: #2d3748;
    font-weight: 600;
}

.length-label small {
    font-size: 13px;
    color: #718096;
}

.length-hint {
    font-size: 13px;
    color: #718096;
    margin: 0;
    font-style: italic;
}

/* Question Textarea Polish */
.question-input textarea {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    font-size: 15px;
    transition: all 0.3s ease;
    resize: vertical;
    min-height: 100px;
}

.question-input textarea:focus {
    outline: none;
    border-color: #9f7aea;
    box-shadow: 0 0 0 3px rgba(159, 122, 234, 0.1);
}

.question-input textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

/* Deck Selection Polish (if visible) */
.deck-selection select {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

.deck-selection select:focus {
    outline: none;
    border-color: #9f7aea;
    box-shadow: 0 0 0 3px rgba(159, 122, 234, 0.1);
}

/* Form Labels Consistency */
.form-group label:not(.checkbox-label):not(.length-option) {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
}

.form-group label .dashicons {
    color: #6b46c1;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .type-cards-grid,
    .spread-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .length-options {
        flex-direction: column;
    }
    
    .length-option {
        min-width: 100%;
    }
}

/* Submit Button Polish */
.submit-reading-btn {
    background: linear-gradient(135deg, #6b46c1 0%, #9f7aea 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.3);
}

.submit-reading-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 70, 193, 0.4);
}

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

.submit-reading-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Disclaimer Checkbox Polish */
.disclaimer-checkbox {
    background: #faf5ff;
    border: 2px solid #e9d8fd;
    border-radius: 12px;
    padding: 16px;
}

.disclaimer-checkbox .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.disclaimer-checkbox input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.disclaimer-checkbox a {
    color: #6b46c1;
    text-decoration: underline;
}

.disclaimer-checkbox a:hover {
    color: #553c9a;
}

/* Force transparent backgrounds on all wrapper elements */
.aior-reading-container,
.aior-reading-form,
.oracle-reading-form {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important; /* Use full width of parent */
}

/* Container width matching tarot reader layout */
.aior-reading-container {
    max-width: 1200px !important; /* Match tarot reader container width */
    width: 100%; /* Take full available width up to max */
    margin: 0 auto;
    padding: 2rem;
}

/* Only individual cards should have white backgrounds */
.type-card,
.spread-card,
.length-option {
    background: white;
}

@media (max-width: 1240px) {
    .aior-reading-container {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .aior-reading-container {
        padding: 1.5rem 1rem;
    }
}

/* Override theme content width constraints */
.entry-content-wrap .aior-reading-container,
.entry-content .aior-reading-container,
.content-wrap .aior-reading-container,
.single-content .aior-reading-container {
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Ensure form groups don't constrain width */
.oracle-reading-form .form-group {
    width: 100% !important;
    max-width: none !important;
}

/* Nuclear option - override EVERYTHING */
.aior-reading-container *,
.aior-reading-form *,
.oracle-reading-form * {
    box-sizing: border-box !important;
}

form.oracle-reading-form {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
}

.aior-reading-form {
    width: 100% !important;
    max-width: none !important;
}

/* Force the reading type and spread grids to be 2 columns */
.type-cards-grid,
.spread-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
    width: 100% !important;
}

/* Deck Selection - Matches Reading Type Style */
.deck-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
    margin-bottom: 24px;
}

.deck-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: block;
}

.deck-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    cursor: pointer;
}

.deck-card:hover {
    border-color: #9f7aea;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(107, 70, 193, 0.15);
}

.deck-card.selected {
    border-color: #6b46c1;
    background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.2);
}

/* Checkmark on selected */
.deck-card.selected::before {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    background: #7c3aed;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.deck-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.deck-card-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

/* Card back thumbnail in header */
.deck-card-thumbnail {
    width: 50px;
    height: 75px;
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid #ddd;
    flex-shrink: 0;
}

.deck-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deck-card-description {
    font-size: 13px;
    color: #718096;
    line-height: 1.5;
}

/**
 * Frontend Spread Preview (v3.18)
 * Shows card layout, position labels, and meanings
 */

.aior-spread-preview {
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.aior-spread-preview.dark-mode {
    background: #2d2d2d;
    border-color: #444;
}

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

.preview-header {
    margin-bottom: 1.5rem;
    text-align: center;
}

.preview-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #2d3748;
    font-weight: 700;
}

.aior-spread-preview.dark-mode .preview-header h3 {
    color: #f0f0f0;
}

.preview-description {
    margin: 0;
    font-size: 14px;
    color: #718096;
    line-height: 1.5;
}

.aior-spread-preview.dark-mode .preview-description {
    color: #b0b0b0;
}

/* Card Layout Container - Using actual grid layout from spread designer */
.preview-cards-container {
    display: grid;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    min-height: 200px;
}

.aior-spread-preview.dark-mode .preview-cards-container {
    background: #1a1a1a;
    border-color: #444;
}

/* Dynamic background for card container */
.preview-cards-container.with-bg-color {
    background-color: inherit;
    border: none;
}

.preview-cards-container.with-bg-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Preview Card - Smaller for grid layout */
.preview-card {
    aspect-ratio: 2 / 3;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
    color: white;
    min-width: 60px;
    min-height: 90px;
}

.preview-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.preview-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-card-number {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #FFD700;
    color: #000;
    font-weight: 700;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    min-width: 18px;
    text-align: center;
}

.preview-card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px;
    font-size: 10px;
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.2;
}

/* Position Meanings Tooltip (appears on card hover) */

/* Responsive Grid for Cards */
@media (max-width: 1400px) {
    .preview-cards-container {
        gap: 0.4rem;
        padding: 0.8rem;
        min-height: 180px;
    }
    
    .preview-card {
        min-width: 50px;
        min-height: 75px;
    }
}

@media (max-width: 1024px) {
    .preview-cards-container {
        gap: 0.3rem;
        padding: 0.6rem;
        min-height: 150px;
    }
    
    .preview-card {
        min-width: 45px;
        min-height: 67px;
    }
    
    .preview-card-label {
        font-size: 8px;
        padding: 3px;
    }
    
    .preview-card-number {
        top: 2px;
        right: 2px;
        font-size: 9px;
        padding: 1px 3px;
    }
}

@media (max-width: 768px) {
    .aior-spread-preview {
        padding: 0.8rem;
        margin-bottom: 1rem;
    }
    
    .preview-cards-container {
        gap: 0.25rem;
        padding: 0.5rem;
        min-height: 120px;
    }
    
    .preview-card {
        min-width: 40px;
        min-height: 60px;
    }
    
    .preview-card-label {
        font-size: 7px;
        padding: 2px;
    }
    
    .preview-card-number {
        top: 2px;
        right: 2px;
        font-size: 8px;
        padding: 1px 2px;
    }
    
    .preview-meanings-legend {
        padding: 0.6rem;
    }
    
    .preview-meaning-item {
        padding: 0.4rem;
        font-size: 11px;
    }
}

