/**
 * WP Tarot Public Styles
 */

/* Ana Container */
.wp-tarot-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Form Wrapper */
.wp-tarot-form-wrapper {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.wp-tarot-form-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

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

.form-header h2 {
    font-size: 32px;
    color: #1a1a1a;
    margin-bottom: 10px;
    font-weight: 700;
}

.form-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.form-group textarea,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #7c3aed;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* Submit Button */
.wp-tarot-submit {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.wp-tarot-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.wp-tarot-submit:active {
    transform: translateY(0);
}

.wp-tarot-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

/* Loading Spinner */
.button-loader .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Result Section */
.wp-tarot-result {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease;
}

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.result-header h3 {
    font-size: 28px;
    margin: 0;
    color: #1a1a1a;
}

.close-result {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-result:hover {
    color: #333;
    background: #f0f0f0;
}

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

.tarot-card {
    text-align: center;
    position: relative;
    animation: cardFlip 0.6s ease;
}

@keyframes cardFlip {
    from {
        transform: rotateY(180deg);
        opacity: 0;
    }
    to {
        transform: rotateY(0);
        opacity: 1;
    }
}

.tarot-card img {
    width: 100%;
    max-width: 150px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.tarot-card:hover img {
    transform: scale(1.05);
}

.tarot-card.reversed img {
    transform: rotate(180deg);
}

.tarot-card.reversed:hover img {
    transform: rotate(180deg) scale(1.05);
}

.tarot-card h4 {
    margin: 15px 0 5px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.tarot-card .card-status {
    font-size: 14px;
    color: #666;
    font-style: italic;
}

/* Interpretation */
.result-interpretation {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    line-height: 1.8;
    color: #444;
    font-size: 16px;
    border-left: 4px solid #7c3aed;
}

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

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

/* Result Actions */
.result-actions {
    text-align: center;
    margin-top: 30px;
}

.new-reading-btn {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-reading-btn:hover {
    background: #6d28d9;
    transform: translateY(-2px);
}

/* User History */
.wp-tarot-history {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 16px;
    margin-top: 30px;
}

.wp-tarot-history h4 {
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

.history-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

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

.history-question {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.history-type {
    font-size: 14px;
    color: #7c3aed;
}

/* Notices */
.wp-tarot-notice {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #f0f8ff;
    border-left: 4px solid #2196F3;
    color: #333;
}

.wp-tarot-notice.error {
    background: #ffebee;
    border-left-color: #f44336;
}

.wp-tarot-notice a {
    color: #2196F3;
    text-decoration: none;
    font-weight: 600;
}

.wp-tarot-notice a:hover {
    text-decoration: underline;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .wp-tarot-container {
        padding: 10px;
    }
    
    .wp-tarot-form-wrapper,
    .wp-tarot-result {
        padding: 25px;
    }
    
    .form-header h2 {
        font-size: 24px;
    }
    
    .result-cards {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 15px;
    }
    
    .tarot-card img {
        max-width: 100px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .close-result {
        position: absolute;
        top: 20px;
        right: 20px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .wp-tarot-form-wrapper,
    .wp-tarot-result {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .form-header h2,
    .result-header h3 {
        color: #fff;
    }
    
    .form-group label {
        color: #e0e0e0;
    }
    
    .form-group textarea,
    .form-group select {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .form-group textarea:focus,
    .form-group select:focus {
        background: #333;
        border-color: #7c3aed;
    }
    
    .result-interpretation {
        background: #2a2a2a;
        color: #e0e0e0;
    }
}
