/* Google Fonts (Imported in index.html) */

/* General Styles */
body {
    font-family: 'Cormorant Garamond', serif;
    background: url('/static/images/mystical_background.jpg') no-repeat center center fixed, linear-gradient(135deg, #4B0082, #191970);
    background-size: cover, cover;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
    margin: 0;
    padding: 0;
    color: #FFFFF0;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(25, 25, 112, 0.6); /* Semi-transparent overlay */
    z-index: -1; /* Ensures it stays behind content */
}

/* Container Decorative Border */
.container {
    width: 90%;
    max-width: 1000px;
    margin: auto;
    overflow: hidden;
    padding: 20px;
    border: 2px solid #FFD700; /* Gold border */
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.4); /* Semi-transparent background */
    box-shadow: 0 6px 25px rgba(0,0,0,0.5);
}

/* Heading Styles */
h1 {
    text-align: center;
    color: #FFD700; /* Gold color */
    font-size: 2.5em;
    margin-bottom: 20px;
    font-family: 'Cinzel Decorative', cursive;
    position: relative;
}

h1 i {
    color: #FFA500; /* Darker gold for icons */
    margin: 0 10px;
}

/* Form Section */
.form-section {
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px dashed #FFD700; /* Dashed gold border */
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.form-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-family: 'Mystery Quest', cursive;
    color: #FFD700; /* Gold color for labels */
}

.form-section input, .form-section select, .form-section button {
    width: 100%;
    padding: 12px;
    margin: 8px 0 20px 0;
    border: none;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
}

.form-section input, .form-section select {
    background: rgba(255, 255, 255, 0.1); /* Slightly transparent */
    color: #FFFFF0;
    border: 1px solid #FFD700;
}

.form-section input::placeholder {
    color: #FFFFF0;
    opacity: 0.7;
}

.form-section button {
    background-color: #FFD700;
    color: #4B0082;
    font-family: 'Cinzel Decorative', cursive;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(255, 215, 0, 0.3);
}

.form-section button:hover {
    background-color: #FFA500; /* Darker gold on hover */
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
}

.form-section button:active {
    transform: scale(1);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

/* Cards Section */
.cards-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.card {
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent */
    border: 2px solid #FFD700; /* Gold border */
    border-radius: 10px;
    width: 200px;
    margin: 10px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, opacity 1s;
    opacity: 0;
    animation: fadeIn 0.8s forwards;
}

.card:hover {
    transform: scale(1.05) rotate(-2deg);
    box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6); /* Golden glow */
}

.card img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    transition: transform 0.5s;
}

/* CSS Classes for Reversed and Upright Cards */
.reversed {
    transform: rotate(180deg);
}

.upright {
    transform: rotate(0deg);
}

/* Animation for Cards */
@keyframes fadeIn {
    0% { opacity: 0; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1); }
}

/* Interpretation Section */
.interpretation {
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    margin-top: 20px;
    font-family: 'Cormorant Garamond', serif;
}

.interpretation h2 {
    font-family: 'Cinzel Decorative', cursive;
    color: #FFD700;
    margin-top: 0;
    font-size: 2em;
}

.interpretation p {
    color: #FFFFF0;
    line-height: 1.6;
    font-size: 1.1em;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right:0;
    bottom:0;
    background: rgba(0,0,0,0.8); /* Darker overlay for focus */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px; /* More padding for smaller screens */
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1); /* Semi-transparent */
    padding: 25px;
    border-radius: 10px;
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 90%;
    overflow-y: auto;
    box-shadow: 0 6px 25px rgba(0,0,0,0.5);
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-60px);
    }
    to {
        transform: translateY(0);
    }
}

.close-button {
    position: absolute;
    top:15px;
    right:20px;
    font-size: 28px;
    color: #FFD700;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover {
    color: #FFA500; /* Darker gold on hover */
}

.modal-content h2 {
    font-family: 'Cinzel Decorative', cursive;
    color: #FFD700;
    margin-top: 0;
}

.modal-content p {
    font-family: 'Cormorant Garamond', serif;
    color: #FFFFF0;
    line-height: 1.6;
}

.modal-content img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 15px;
    border: 2px solid #FFD700;
}

/* Loading Indicator Styles */
#loading {
    text-align: center;
    margin-top: 20px;
    font-size: 1.2em;
    color: #FFD700;
    font-family: 'Cormorant Garamond', serif;
}

/* Responsive Design Enhancements */

/* Larger devices (Desktops) */
@media (min-width: 769px) {
    .cards-section {
        justify-content: space-around;
    }
    .card {
        width: 200px;
    }
}

/* Medium devices (Tablets) */
@media (min-width: 481px) and (max-width: 768px) {
    .card {
        width: 45%;
    }
}

/* Small devices (Mobile Phones) */
@media (max-width: 480px) {
    .card {
        width: 90%;
    }
    h1 {
        font-size: 2em;
    }
    .form-section input, .form-section select, .form-section button {
        font-size: 1em;
    }
    .interpretation {
        padding: 20px;
    }
    .modal-content {
        padding: 15px;
    }
    .close-button {
        font-size: 24px;
    }
    .interpretation h2 {
        font-size: 1.8em;
    }
    .interpretation p {
        font-size: 1em;
    }
}
