/**
 * Frontend My Readings Styles
 * Member dashboard styling
 * @package AI_Tarot_Reader
 * @since 3.4.2
 */

/* ========================================
   LOGIN REQUIRED STATE
======================================== */
.tarot-readings-login-required {
    max-width: 500px;
    margin: 60px auto;
    padding: 50px 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    text-align: center;
}

.tarot-readings-login-required .login-icon {
    margin-bottom: 20px;
}

.tarot-readings-login-required .dashicons {
    font-size: 64px;
    width: 64px;
    height: 64px;
    color: #8e44ad;
    opacity: 0.3;
}

.tarot-readings-login-required h3 {
    margin: 20px 0 15px;
    color: #333;
    font-size: 24px;
}

.tarot-readings-login-required p {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.login-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* ========================================
   MAIN CONTAINER
======================================== */
.tarot-my-readings-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   FILTERS BAR
======================================== */
.readings-filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.readings-stats h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 24px;
}

.readings-stats p {
    margin: 0;
    color: #999;
    font-size: 14px;
}

.readings-filters {
    display: flex;
    gap: 10px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: #e8d9f3;
    color: #6c3483;
}

.filter-btn.active {
    background: #8e44ad;
    color: #fff;
}

.filter-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ========================================
   NO READINGS STATE
======================================== */
.no-readings-state {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #ddd;
}

.no-readings-state .dashicons {
    font-size: 72px;
    width: 72px;
    height: 72px;
    color: #ccc;
    margin-bottom: 20px;
}

.no-readings-state h3 {
    margin: 20px 0 10px;
    color: #666;
    font-size: 22px;
}

.no-readings-state p {
    color: #999;
    font-size: 16px;
    max-width: 500px;
    margin: 0 auto;
}

/* ========================================
   READINGS GRID
======================================== */
.readings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.readings-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

/* ========================================
   READING CARD
======================================== */
.reading-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
}

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

.reading-card.saved::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(135deg, #f8f4fb 0%, #fff 100%);
    border-bottom: 1px solid #f0e6f6;
}

.reading-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reading-type {
    font-weight: 700;
    color: #8e44ad;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reading-date {
    font-size: 13px;
    color: #999;
}

.save-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #999;
    transition: all 0.2s ease;
    border-radius: 50%;
}

.save-toggle:hover {
    background: #f5f5f5;
    color: #e74c3c;
    transform: scale(1.15);
}

.save-toggle.saved {
    color: #e74c3c;
}

.save-toggle .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

/* Card Body */
.card-body {
    padding: 20px;
}

.spread-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.spread-info strong {
    color: #333;
    font-size: 16px;
}

.card-count {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

.reading-question {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 3px solid #8e44ad;
    min-height: 70px;
}

.reading-question p {
    margin: 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reading-badges {
    display: flex;
    gap: 8px;
}

.length-badge {
    display: inline-block;
    padding: 5px 12px;
    background: #e8d9f3;
    color: #6c3483;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Footer */
.card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid #f0f0f0;
}

.card-footer .view-reading-btn {
    flex: 1;
}

/* ========================================
   BUTTONS
======================================== */
.tarot-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    justify-content: center;
}

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

.tarot-btn-primary:hover {
    background: #7d3c98;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
}

.tarot-btn-secondary {
    background: #ecf0f1;
    color: #555;
}

.tarot-btn-secondary:hover {
    background: #d5dbdb;
}

.tarot-btn-icon {
    padding: 8px;
    background: transparent;
    color: #999;
    border-radius: 8px;
}

.tarot-btn-icon:hover {
    background: #ffebee;
    color: #e74c3c;
}

.tarot-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ========================================
   PAGINATION
======================================== */
.readings-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #fff;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.page-number:hover {
    background: #f0e6f6;
    color: #6c3483;
}

.page-number.current {
    background: #8e44ad;
    color: #fff;
    box-shadow: 0 4px 8px rgba(142, 68, 173, 0.3);
}

/* ========================================
   READING MODAL
======================================== */
.reading-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    display: none;
}

.reading-modal-overlay.active {
    display: block;
}

.reading-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 9999;
    overflow: hidden;
    display: none;
}

.reading-modal.active {
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: #fff;
}

.modal-header h2 {
    margin: 0;
    font-size: 22px;
}

.modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
}

.modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.modal-date {
    color: #999;
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-question {
    background: #f8f4fb;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 4px solid #8e44ad;
}

.modal-question strong {
    display: block;
    color: #8e44ad;
    margin-bottom: 10px;
    font-size: 15px;
}

.modal-question p {
    margin: 0;
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    font-style: italic;
}

.modal-cards {
    margin-bottom: 30px;
}

.modal-cards h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0e6f6;
}

.modal-card {
    padding: 15px;
    margin: 10px 0;
    background: #fafafa;
    border-left: 4px solid #8e44ad;
    border-radius: 6px;
}

.modal-card strong {
    color: #8e44ad;
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.modal-card .card-name {
    color: #333;
    font-size: 15px;
}

.modal-card .reversed {
    color: #e74c3c;
    font-style: italic;
    font-weight: 600;
}

.modal-interpretation {
    padding-top: 25px;
    border-top: 2px solid #f0e6f6;
}

.modal-interpretation h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
}

.modal-interpretation p {
    color: #555;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* ========================================
   LOADING STATES
======================================== */
.reading-card.loading {
    opacity: 0.5;
    pointer-events: none;
}

.reading-card.deleting {
    animation: slideOut 0.4s ease-out forwards;
}

@keyframes slideOut {
    to {
        opacity: 0;
        transform: translateX(-100%);
    }
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .readings-filters-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }
    
    .readings-stats {
        text-align: center;
    }
    
    .readings-filters {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .readings-grid {
        grid-template-columns: 1fr;
    }
    
    .reading-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header, .modal-content {
        padding: 20px;
    }
    
    .login-actions {
        flex-direction: column;
    }
    
    .tarot-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 15px;
    }
    
    .reading-question {
        padding: 12px;
    }
    
    .filter-btn {
        font-size: 13px;
        padding: 8px 16px;
    }
}
