:root {
    --background: #121212;
    --surface: #1E1E1E;
    --primary: #BB86FC;
    --primary-variant: #3700B3;
    --secondary: #03DAC6;
    --on-surface: #FFFFFF;
    --on-surface-secondary: #B3B3B3;
    --shadow-color: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background);
    color: var(--on-surface);
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

#app-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    box-sizing: border-box;
}

.screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative; /* Para o loader-overlay */
}

.screen.active {
    display: flex;
}

h1 {
    font-size: 4rem;
    font-weight: 300;
    color: var(--primary);
    margin-bottom: 0;
}

h2 {
    font-weight: 400;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--surface);
    padding-bottom: 10px;
    width: 100%;
}

p {
    color: var(--on-surface-secondary);
    font-weight: 300;
    font-size: 1.2rem;
}

.btn {
    background-color: var(--surface);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    transition: background-color 0.3s, box-shadow 0.3s;
    margin-top: 20px;
}

.btn:hover {
    background-color: var(--primary);
    color: var(--background);
    box-shadow: 0 4px 15px rgba(187, 134, 252, 0.3);
}

.btn:disabled {
    border-color: var(--on-surface-secondary);
    color: var(--on-surface-secondary);
    cursor: not-allowed;
    background-color: transparent;
    box-shadow: none;
}

.btn.btn-primary {
    background-color: var(--primary);
    color: var(--background);
}

.btn.btn-primary:hover {
    background-color: var(--primary-variant);
}

textarea, input[type="text"] {
    width: 100%;
    background-color: var(--surface);
    border: 1px solid var(--on-surface-secondary);
    border-radius: 8px;
    padding: 15px;
    font-size: 1rem;
    color: var(--on-surface);
    box-sizing: border-box;
    margin-bottom: 20px;
    font-family: 'Roboto', sans-serif;
}

textarea {
    min-height: 150px;
    resize: vertical;
}

.card-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.card, .palette-card {
    background-color: var(--surface);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    border: 1px solid transparent;
}

.card:hover, .palette-card:hover {
    transform: translateY(-3px);
}

.card.selected {
    background-color: var(--primary);
    color: var(--background);
    border-color: var(--primary);
    font-weight: 500;
}

.palette-card {
    width: 100px;
    height: 40px;
    display: flex;
}

.palette-card.selected {
    border: 2px solid var(--primary);
}

#dream-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: var(--surface);
}

.refine-container {
    display: flex;
    width: 100%;
    gap: 10px;
}

.btn-icon {
    background-color: var(--primary);
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.btn-icon:hover {
    background-color: var(--primary-variant);
}

.btn-icon .material-icons {
    color: var(--background);
}

.rating-stars {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.rating-stars .material-icons {
    font-size: 3rem;
    color: var(--on-surface-secondary);
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.rating-stars .material-icons:hover {
    transform: scale(1.1);
}

.rating-stars .material-icons.selected, 
.rating-stars .material-icons.hovered {
    color: var(--primary);
}

.agent-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

#interpretation-text.card {
    background-color: var(--surface);
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    font-weight: 300;
    line-height: 1.6;
    width: 100%;
    box-sizing: border-box;
}

/* Loader */
.loader {
    border: 4px solid var(--surface);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Fade-in animations */
.fade-in {
    animation: fadeIn 0.8s ease-in-out forwards;
    opacity: 0;
}

.fade-in-delay-1 {
    animation: fadeIn 0.8s ease-in-out 0.5s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 0.8s ease-in-out 1s forwards;
    opacity: 0;
}

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

/* Loader Overlay for refinement */
.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px; /* Match image border-radius */
}
