/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #f0f0f0;
    min-height: 100vh;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1, h2, h3 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #e6e6e6;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
    text-align: center;
    background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 i {
    margin-right: 15px;
    color: #c792ea;
}

h2 {
    font-size: 1.8rem;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(199, 146, 234, 0.3);
}

h2 i {
    margin-right: 10px;
    color: #82aaff;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #c3e88d;
}

.subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #a9b7d6;
    margin-bottom: 40px;
    font-weight: 300;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(25, 25, 45, 0.7);
    border-radius: 20px;
    border: 1px solid rgba(130, 170, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Question Section */
.question-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(130, 170, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    background: rgba(20, 20, 35, 0.8);
    border: 2px solid rgba(130, 170, 255, 0.2);
    border-radius: 10px;
    color: #f0f0f0;
    font-size: 1.1rem;
    font-family: 'Roboto', sans-serif;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

textarea:focus {
    outline: none;
    border-color: #82aaff;
    box-shadow: 0 0 0 3px rgba(130, 170, 255, 0.2);
}

textarea::placeholder {
    color: #6b7b9c;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

button {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

button i {
    font-size: 1.2rem;
}

.btn-primary {
    background: linear-gradient(135deg, #ff6b6b 0%, #c44569 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ff5252 0%, #b33951 100%);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(255, 107, 107, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #3db8af 0%, #358f7d 100%);
    transform: translateY(-3px);
    box-shadow: 0 7px 15px rgba(78, 205, 196, 0.3);
}

.btn-outline {
    background: transparent;
    color: #82aaff;
    border: 2px solid #82aaff;
}

.btn-outline:hover {
    background: rgba(130, 170, 255, 0.1);
    transform: translateY(-3px);
}

.hint {
    margin-top: 15px;
    padding: 15px;
    background: rgba(130, 170, 255, 0.1);
    border-radius: 10px;
    color: #a9b7d6;
    font-size: 0.95rem;
}

.hint i {
    color: #ffd166;
    margin-right: 10px;
}

/* Cards Section */
.cards-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(130, 170, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    justify-content: center;
    min-height: 300px;
    align-items: center;
}

.placeholder {
    text-align: center;
    color: #6b7b9c;
    padding: 40px;
    width: 100%;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: rgba(130, 170, 255, 0.3);
}

.placeholder-sub {
    font-size: 0.9rem;
    margin-top: 10px;
    color: #5a6780;
}

/* Tarot Card Styles */
.tarot-card {
    width: 200px;
    height: 320px;
    background: linear-gradient(145deg, #2d2d44, #252536);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    transition: all 0.4s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(199, 146, 234, 0.2);
}

.tarot-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    border-color: rgba(199, 146, 234, 0.5);
}

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

.tarot-card.reversed:hover {
    transform: rotate(180deg) translateY(-10px) scale(1.03);
}

.card-suit {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.card-name {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    text-align: center;
    margin: 10px 0;
    color: #f0f0f0;
}

.card-meaning {
    font-size: 0.9rem;
    text-align: center;
    color: #a9b7d6;
    margin-top: 10px;
    line-height: 1.4;
}

.card-position {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(199, 146, 234, 0.2);
    color: #c792ea;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.reversed-indicator {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Reading Summary */
.reading-summary {
    margin-top: 30px;
    padding: 20px;
    background: rgba(20, 20, 35, 0.6);
    border-radius: 10px;
    border-left: 4px solid #82aaff;
}

.reading-summary h3 {
    color: #82aaff;
    margin-bottom: 10px;
}

/* Explanation Section */
.explanation-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(130, 170, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.explanation-container {
    min-height: 200px;
}

.empty-explanation {
    text-align: center;
    padding: 40px;
    color: #6b7b9c;
}

.empty-explanation i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: rgba(130, 170, 255, 0.3);
}

.card-explanation {
    background: rgba(20, 20, 35, 0.6);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    border-left: 4px solid #c792ea;
}

.card-explanation h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.card-explanation h3 .card-icon {
    font-size: 1.8rem;
}

.explanation-text {
    margin-bottom: 15px;
    line-height: 1.7;
}

.keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.keyword {
    background: rgba(130, 170, 255, 0.1);
    color: #82aaff;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Info Section */
.info-section {
    background: rgba(30, 30, 46, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(130, 170, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.info-card {
    background: rgba(20, 20, 35, 0.6);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #c792ea;
}

.info-card h3 {
    margin-bottom: 15px;
}

.info-card p {
    color: #a9b7d6;
    line-height: 1.6;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px;
    background: rgba(25, 25, 45, 0.7);
    border-radius: 15px;
    margin-top: 40px;
    color: #a9b7d6;
    border-top: 1px solid rgba(130, 170, 255, 0.1);
}

.footer-links {
    margin: 20px 0;
}

.footer-links a {
    color: #82aaff;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #c792ea;
    text-decoration: underline;
}

.copyright {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #6b7b9c;
}

.copyright i {
    color: #ff6b6b;
    margin: 0 5px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #252536 0%, #1a1a2e 100%);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid rgba(199, 146, 234, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    font-size: 2rem;
    color: #ff6b6b;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #ff5252;
}

/* Modal card styles */
.modal-card-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(130, 170, 255, 0.2);
}

.modal-card-header h2 {
    font-size: 2.2rem;
    color: #f0f0f0;
    margin-bottom: 10px;
}

.card-suit-modal {
    color: #82aaff;
    font-size: 1.1rem;
    font-style: italic;
}

.modal-card-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.modal-card-meaning,
.modal-card-description,
.modal-card-keywords,
.modal-card-advice {
    background: rgba(20, 20, 35, 0.6);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid;
}

.modal-card-meaning {
    border-left-color: #ff6b6b;
}

.modal-card-description {
    border-left-color: #4ecdc4;
}

.modal-card-keywords {
    border-left-color: #c792ea;
}

.modal-card-advice {
    border-left-color: #ffd166;
}

.modal-card-content h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #f0f0f0;
}

.modal-card-content h3 i {
    font-size: 1.2rem;
}

.keywords-modal {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.keyword-modal {
    background: rgba(130, 170, 255, 0.1);
    color: #82aaff;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Modal about and card list */
.modal-about {
    line-height: 1.7;
    color: #a9b7d6;
}

.modal-about p {
    margin-bottom: 15px;
}

.card-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.card-list-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(20, 20, 35, 0.6);
    border-radius: 10px;
    border-left: 4px solid #c792ea;
    transition: transform 0.3s;
}

.card-list-item:hover {
    transform: translateX(5px);
    background: rgba(30, 30, 46, 0.8);
}

.card-list-emoji {
    font-size: 1.8rem;
}

.card-list-name {
    flex: 1;
    font-weight: 500;
    color: #f0f0f0;
}

.card-list-suit {
    color: #82aaff;
    font-size: 0.9rem;
    background: rgba(130, 170, 255, 0.1);
    padding: 5px 10px;
    border-radius: 15px;
}

/* Loading states */
.loading-explanation {
    text-align: center;
    padding: 60px 40px;
    color: #a9b7d6;
}

.loading-spinner {
    font-size: 3.5rem;
    margin-bottom: 25px;
    color: #c792ea;
}

.loading-spinner .fa-spin {
    animation: fa-spin 2s infinite linear;
}

.loading-sub {
    font-size: 0.9rem;
    color: #6b7b9c;
    margin-top: 10px;
}

.loading-small {
    font-size: 0.8rem;
    color: #82aaff;
    margin-left: 10px;
    font-weight: normal;
}

.advice-loading {
    color: #a9b7d6;
    font-style: italic;
    padding: 15px;
    background: rgba(130, 170, 255, 0.1);
    border-radius: 10px;
    border-left: 3px solid #82aaff;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        min-width: 100%;
    }
    
    .tarot-card {
        width: 160px;
        height: 260px;
    }
    
    .info-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    .tarot-card {
        width: 140px;
        height: 230px;
        padding: 15px;
    }
    
    .card-name {
        font-size: 1.1rem;
    }
}
