/* WP Tarot - Frontend Styles */

:root {
    --wpt-primary: #6B46C1;
    --wpt-primary-dark: #553C9A;
    --wpt-primary-light: #9F7AEA;
    --wpt-secondary: #ED8936;
    --wpt-success: #48BB78;
    --wpt-danger: #F56565;
    --wpt-warning: #ED8936;
    --wpt-info: #4299E1;
    --wpt-dark: #2D3748;
    --wpt-gray: #718096;
    --wpt-light: #F7FAFC;
    --wpt-border: #E2E8F0;
    --wpt-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --wpt-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --wpt-radius: 8px;
    --wpt-radius-lg: 12px;
    --wpt-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Container */
.wpt-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.wpt-reader-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--wpt-radius-lg);
    padding: 40px;
    box-shadow: var(--wpt-shadow-lg);
    position: relative;
    overflow: hidden;
}

.wpt-reader-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 15s linear infinite;
}

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

/* Header */
.wpt-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.wpt-title {
    color: white;
    font-size: 2.5em;
    margin: 0 0 10px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.wpt-icon {
    font-size: 1.2em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.wpt-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.1em;
    margin: 0;
}

/* Form Section */
.wpt-form-section {
    background: white;
    border-radius: var(--wpt-radius-lg);
    padding: 30px;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.wpt-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.wpt-form-group {
    display: flex;
    flex-direction: column;
}

.wpt-form-group label {
    color: var(--wpt-dark);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wpt-form-group input,
.wpt-form-group textarea,
.wpt-form-group select {
    padding: 12px 15px;
    border: 2px solid var(--wpt-border);
    border-radius: var(--wpt-radius);
    font-size: 1em;
    transition: var(--wpt-transition);
    background: white;
}

.wpt-form-group input:focus,
.wpt-form-group textarea:focus,
.wpt-form-group select:focus {
    outline: none;
    border-color: var(--wpt-primary);
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.1);
}

.wpt-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.wpt-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--wpt-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: var(--wpt-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.wpt-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.wpt-btn:hover::before {
    width: 300px;
    height: 300px;
}

.wpt-btn-primary {
    background: linear-gradient(135deg, var(--wpt-primary) 0%, var(--wpt-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 6px rgba(107, 70, 193, 0.3);
}

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

.wpt-btn-secondary {
    background: var(--wpt-secondary);
    color: white;
}

.wpt-btn-ghost {
    background: transparent;
    color: var(--wpt-primary);
    border: 2px solid var(--wpt-primary);
}

.wpt-btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
    width: 100%;
    margin-top: 20px;
}

/* Loading State */
.wpt-loading {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: var(--wpt-radius-lg);
}

.wpt-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--wpt-border);
    border-top-color: var(--wpt-primary);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

/* Results Section */
.wpt-results {
    background: white;
    border-radius: var(--wpt-radius-lg);
    padding: 30px;
    position: relative;
    z-index: 1;
}

.wpt-section-title {
    color: var(--wpt-dark);
    font-size: 1.5em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--wpt-border);
}

/* Cards Grid */
.wpt-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.wpt-card {
    background: white;
    border-radius: var(--wpt-radius);
    overflow: hidden;
    box-shadow: var(--wpt-shadow);
    transition: var(--wpt-transition);
    cursor: pointer;
    position: relative;
}

.wpt-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: var(--wpt-shadow-lg);
}

.wpt-card-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
}

.wpt-card-info {
    padding: 15px;
    background: linear-gradient(to bottom, rgba(107, 70, 193, 0.05), white);
}

.wpt-card-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--wpt-dark);
    margin: 0 0 8px;
}

.wpt-card-keywords {
    font-size: 0.9em;
    color: var(--wpt-gray);
    font-style: italic;
}

.wpt-card-meaning {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--wpt-border);
}

.wpt-card-meaning-title {
    font-size: 0.85em;
    font-weight: 600;
    color: var(--wpt-primary);
    margin-bottom: 5px;
}

.wpt-card-meaning-text {
    font-size: 0.9em;
    color: var(--wpt-dark);
    line-height: 1.4;
}

/* Interpretation */
.wpt-interpretation {
    background: linear-gradient(135deg, rgba(107, 70, 193, 0.05) 0%, rgba(159, 122, 234, 0.05) 100%);
    border-left: 4px solid var(--wpt-primary);
    padding: 25px;
    border-radius: var(--wpt-radius);
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--wpt-dark);
    font-size: 1.05em;
}

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

.wpt-interpretation p:last-child {
    margin-bottom: 0;
}

/* Actions */
.wpt-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Daily Card */
.wpt-daily-card {
    background: white;
    border-radius: var(--wpt-radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--wpt-shadow);
}

.wpt-daily-card h3 {
    color: var(--wpt-primary);
    margin-bottom: 20px;
}

#wpt-daily-result {
    margin-top: 20px;
}

/* Card Library */
.wpt-card-library {
    padding: 20px 0;
}

.wpt-card-grid {
    display: grid;
    gap: 20px;
}

.wpt-card-item {
    background: white;
    border-radius: var(--wpt-radius);
    overflow: hidden;
    box-shadow: var(--wpt-shadow);
    transition: var(--wpt-transition);
    cursor: pointer;
}

.wpt-card-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--wpt-shadow-lg);
}

.wpt-card-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.wpt-card-item h4 {
    padding: 10px 15px 5px;
    margin: 0;
    color: var(--wpt-dark);
    font-size: 1em;
}

.wpt-card-item .card-keywords {
    padding: 0 15px 15px;
    font-size: 0.85em;
    color: var(--wpt-gray);
    font-style: italic;
}

/* Responsive Design */
@media (max-width: 768px) {
    .wpt-reader-wrapper {
        padding: 20px;
    }
    
    .wpt-title {
        font-size: 2em;
    }
    
    .wpt-form-section {
        padding: 20px;
    }
    
    .wpt-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .wpt-btn-large {
        padding: 14px 24px;
    }
    
    .wpt-actions {
        flex-direction: column;
    }
    
    .wpt-actions .wpt-btn {
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .wpt-reader-wrapper {
        background: white !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    .wpt-form-section,
    .wpt-actions,
    .wpt-loading {
        display: none !important;
    }
    
    .wpt-card {
        page-break-inside: avoid;
    }
}

/* Animation Classes */
.wpt-fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.wpt-slide-up {
    animation: slideUp 0.5s ease-out;
}

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

/* Card Flip Animation */
.wpt-card-flip {
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.wpt-card-flip.flipped {
    transform: rotateY(180deg);
}

/* Tooltip */
.wpt-tooltip {
    position: relative;
}

.wpt-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--wpt-dark);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.wpt-tooltip:hover::after {
    opacity: 1;
}