/* AI Tarot Reader - Public Styles */

.ai-tarot-reader-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Header */
.tarot-header {
    text-align: center;
    margin-bottom: 40px;
}

.tarot-header h2 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.tarot-header p {
    font-size: 16px;
    color: #7f8c8d;
}

.reading-info {
    font-weight: 600;
    color: #8e44ad;
}

/* Steps */
.tarot-step {
    min-height: 400px;
}

.tarot-step.hidden {
    display: none;
}

/* Selection Step */
.selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.selection-group h3 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #34495e;
}

.option-grid {
    display: grid;
    gap: 15px;
}

.option-card {
    padding: 20px;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.option-card:hover {
    border-color: #8e44ad;
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.1);
    transform: translateY(-2px);
}

.option-card.selected {
    border-color: #8e44ad;
    background: #f8f4fc;
}

.option-card h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #2c3e50;
}

.option-card p {
    margin: 0;
    font-size: 14px;
    color: #7f8c8d;
}

.card-count {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    background: #8e44ad;
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Question Input */
.question-container {
    max-width: 700px;
    margin: 30px auto 20px;
    text-align: center;
    display: block !important;
    visibility: visible !important;
}

.question-container h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #34495e;
    font-weight: 600;
}

.question-input {
    width: 100%;
    max-width: 100%;
    padding: 15px;
    font-size: 15px;
    font-family: inherit;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    resize: vertical;
    transition: border-color 0.3s ease;
    background: #fff;
    color: #2c3e50;
    box-sizing: border-box;
    display: block;
}

.question-input:focus {
    outline: none;
    border-color: #8e44ad;
    box-shadow: 0 0 0 3px rgba(142, 68, 173, 0.1);
}

.question-input::placeholder {
    color: #95a5a6;
    font-style: italic;
}

.character-count {
    text-align: right;
    font-size: 13px;
    color: #7f8c8d;
    margin-top: 5px;
    display: block;
}

.character-count span {
    font-weight: 600;
    color: #8e44ad;
}

/* Actions */
/* Disclaimer Container */
.disclaimer-container {
    margin: 30px auto 20px;
    max-width: 600px;
}

.disclaimer-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.disclaimer-checkbox:hover {
    background: #e9ecef;
    border-color: #8e44ad;
}

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

.disclaimer-text {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

.disclaimer-text a {
    color: #8e44ad;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.disclaimer-text a:hover {
    color: #732d91;
    text-decoration: underline;
}

.tarot-actions {
    text-align: center;
    margin-top: 30px;
}

.tarot-button {
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.tarot-button.primary {
    background: #8e44ad;
    color: #fff;
}

.tarot-button.primary:hover:not(:disabled) {
    background: #732d91;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
}

.tarot-button.primary:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.tarot-button.secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.tarot-button.secondary:hover {
    background: #bdc3c7;
}

.tarot-button .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

/* Drawing Animation */
.drawing-animation {
    text-align: center;
    padding: 80px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    border: 4px solid #ecf0f1;
    border-top-color: #8e44ad;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.drawing-message {
    font-size: 18px;
    color: #7f8c8d;
    font-style: italic;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Cards Display */
.cards-display-wrapper {
    margin-bottom: 40px;
}

.spread-title {
    text-align: center;
    font-size: 22px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.cards-display {
    position: relative;
    min-height: 500px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 80px 40px 60px 40px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Single Card Layout */
.cards-display.layout-single {
    min-height: 400px;
    padding: 60px 40px;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.cards-display.layout-single .tarot-card {
    position: static !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
    margin: 0;
}

/* Three Card Layout */
.cards-display.layout-horizontal {
    gap: 30px;
    min-height: 450px;
    flex-wrap: nowrap;
    padding: 60px 40px;
}

.cards-display.layout-horizontal .tarot-card {
    position: static;
    transform: none !important;
    flex-shrink: 0;
}

/* Celtic Cross Layout */
.cards-display.layout-celtic-cross {
    min-height: 750px;
    padding: 100px 80px 80px 80px;
    display: block;
}

/* Grid Layout */
.cards-display.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    min-height: 500px;
    padding: 60px 40px;
}

.cards-display.layout-grid .tarot-card {
    position: static;
    transform: none !important;
}

/* Custom Spread Layout (Grid-based positioning) */
.cards-display.layout-custom {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(5, auto);
    gap: 20px;
    min-height: 500px;
    padding: 60px 40px;
    justify-items: center;
    align-items: center;
}

.cards-display.layout-custom .tarot-card {
    position: static;
    transform: none !important;
}

/* Card Sizing */
.tarot-card {
    position: absolute;
    width: 140px;
    height: 220px;
    opacity: 0;
    transition: all 0.5s ease;
}

.tarot-card.show {
    opacity: 1;
}

.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    background: #fff;
    cursor: pointer;
    transition: transform 0.3s ease, z-index 0s;
}

.card-inner:hover {
    transform: scale(1.05) !important;
    z-index: 1000 !important;
}

.tarot-card:hover {
    z-index: 1000 !important;
}

.card-image {
    width: 100%;
    height: 100%;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

/* Reversed cards - rotate the image, not the overlay */
.tarot-card.reversed .card-image {
    transform: rotate(180deg);
}

/* Card Info Overlay - Full card coverage with better readability */
.card-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    padding: 20px 15px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s ease;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 8px;
}

/* For cards rotated 90 degrees, swap width/height for the overlay */
.tarot-card[data-rotation="90"] .card-info-overlay,
.tarot-card[data-rotation="-90"] .card-info-overlay {
    width: 220px;
    height: 140px;
    left: 50%;
    top: 50%;
    margin-left: -110px;
    margin-top: -70px;
}

.card-inner:hover .card-info-overlay {
    opacity: 1;
}

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

.card-info-overlay .card-name {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.card-info-overlay .card-orientation {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-style: italic;
    color: #d1d5db;
}

.card-info-overlay .card-keywords {
    margin: 0;
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
}

/* Interpretation */
.interpretation-section {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.interpretation-section h3 {
    margin-top: 0;
    font-size: 24px;
    color: #2c3e50;
    border-bottom: 2px solid #8e44ad;
    padding-bottom: 10px;
}

.interpretation-text {
    font-size: 16px;
    line-height: 1.8;
    color: #34495e;
}

.interpretation-text p {
    margin-bottom: 15px;
}

/* Error Message */
.tarot-error {
    background: #e74c3c;
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
}

.tarot-error.hidden {
    display: none;
}

.error-content {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.error-content .dashicons {
    font-size: 24px;
    margin-right: 10px;
}

.error-content p {
    margin: 0;
    font-size: 16px;
}

/* Dark Theme */
.ai-tarot-reader-container[data-theme="dark"] {
    background: #1a1a2e;
    color: #eee;
}

.ai-tarot-reader-container[data-theme="dark"] .tarot-header h2,
.ai-tarot-reader-container[data-theme="dark"] .selection-group h3 {
    color: #eee;
}

.ai-tarot-reader-container[data-theme="dark"] .option-card {
    background: #16213e;
    border-color: #0f3460;
    color: #eee;
}

.ai-tarot-reader-container[data-theme="dark"] .option-card.selected {
    background: #8e44ad;
    border-color: #732d91;
}

.ai-tarot-reader-container[data-theme="dark"] .interpretation-section {
    background: #16213e;
    color: #eee;
}

/* Responsive */
@media (max-width: 768px) {
    .selection-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .question-container {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .question-input {
        font-size: 14px;
        padding: 12px;
    }
    
    .cards-display {
        padding: 40px 20px 20px 20px;
        min-height: 400px;
    }
    
    .cards-display.layout-celtic-cross {
        min-height: 600px;
        padding: 60px 30px 40px 30px;
    }
    
    .tarot-card {
        width: 110px;
        height: 173px;
    }
    
    .cards-display.layout-horizontal {
        flex-wrap: wrap;
        gap: 15px;
        justify-content: center;
    }
    
    .cards-display.layout-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
        padding: 40px 15px;
    }
    
    .cards-display.layout-grid .tarot-card {
        width: 100%;
        max-width: 110px;
        height: 173px;
        margin: 0 auto;
    }
    
    .tarot-button {
        padding: 12px 24px;
        font-size: 14px;
        margin: 5px;
    }
    
    .card-info-overlay {
        padding: 15px 10px;
    }
    
    .card-info-overlay h4 {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .card-info-overlay .card-name {
        font-size: 14px;
    }
    
    .card-info-overlay .card-orientation {
        font-size: 11px;
        margin-bottom: 6px;
    }
    
    .card-info-overlay .card-keywords {
        font-size: 10px;
    }
}
/* Reading Length Selector */
.reading-length-container {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
}

.reading-length-container h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.length-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 12px;
}

.length-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.length-option:hover {
    border-color: #8e44ad;
    background: #f9f9f9;
    transform: translateY(-2px);
}

.length-option input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.length-option input[type="radio"]:checked + .length-label {
    color: #8e44ad;
}

.length-option:has(input[type="radio"]:checked) {
    border-color: #8e44ad;
    background: #f8f4fb;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.15);
}

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

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

.length-label small {
    font-size: 12px;
    color: #7f8c8d;
}

.length-description {
    font-size: 13px;
    color: #7f8c8d;
    margin: 10px 0 0 0;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .length-options {
        grid-template-columns: 1fr;
    }
    
    .length-option {
        padding: 12px;
    }
}

/* Deck Selection */
.deck-selection-container {
    margin: 30px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e1e8ed;
}

.deck-selection-container h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-weight: 600;
}

.deck-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    margin-bottom: 12px;
}

.deck-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-option:hover {
    border-color: #8e44ad;
    background: #f9f9f9;
    transform: translateY(-2px);
}

.deck-option input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.deck-option input[type="radio"]:checked + .deck-label {
    color: #8e44ad;
}

.deck-option:has(input[type="radio"]:checked) {
    border-color: #8e44ad;
    background: #f8f4fb;
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.15);
}

.deck-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.deck-label strong {
    font-size: 15px;
    color: #2c3e50;
}

.deck-label small {
    font-size: 12px;
    color: #7f8c8d;
}

.deck-description {
    font-size: 13px;
    color: #7f8c8d;
    margin: 10px 0 0 0;
    text-align: center;
}

@media (max-width: 768px) {
    .deck-options {
        grid-template-columns: 1fr;
    }
    
    .deck-option {
        padding: 12px;
    }
}

/* Reflection Questions Section */
.reflection-section {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f4fb 0%, #fff 100%);
    border-radius: 12px;
    border: 2px solid #e8d9f3;
}

.reflection-section h3 {
    color: #8e44ad;
    font-size: 24px;
    margin-bottom: 12px;
    text-align: center;
}

.reflection-intro {
    text-align: center;
    color: #5d6d7e;
    font-size: 15px;
    margin-bottom: 25px;
    font-style: italic;
}

.reflection-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reflection-question {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 18px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e8d9f3;
    transition: all 0.3s ease;
}

.reflection-question:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.15);
    border-color: #8e44ad;
}

.question-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8e44ad 0%, #b968c7 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.question-text {
    flex: 1;
    color: #2c3e50;
    font-size: 16px;
    line-height: 1.6;
}

/* Single option hiding */
.single-option {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .reflection-section {
        padding: 20px;
        margin-top: 30px;
    }
    
    .reflection-section h3 {
        font-size: 20px;
    }
    
    .reflection-question {
        padding: 14px;
    }
    
    .question-number {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .question-text {
        font-size: 14px;
    }
}

/* Extra Small Mobile Devices - Better Card Containment */
@media (max-width: 480px) {
    .cards-display {
        padding: 30px 15px 15px 15px;
        min-height: 350px;
    }
    
    .cards-display.layout-celtic-cross {
        min-height: 500px;
        padding: 40px 15px 20px 15px;
    }
    
    .tarot-card {
        width: 90px !important;
        height: 142px !important;
    }
    
    .cards-display.layout-horizontal {
        gap: 10px;
    }
    
    .cards-display.layout-grid {
        grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
        gap: 10px;
        padding: 30px 10px;
    }
    
    .cards-display.layout-grid .tarot-card {
        max-width: 90px;
        height: 142px;
    }
    
    .card-inner {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
}

/* Save Reading Button */
.save-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.save-btn.saved {
    background: #27ae60 !important;
    border-color: #27ae60 !important;
    color: white !important;
}

.save-btn.saved:hover {
    background: #229954 !important;
}

/* Spinning animation for loading */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.dashicons.spin {
    animation: spin 1s linear infinite;
}
