* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', 'Comfortaa', sans-serif;
    background: linear-gradient(135deg, #1a0b2e, #2d1b3d, #4a2c5a);
    color: #ffffff;
    min-height: 100vh;
    line-height: 1.6;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

.header {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 15px 0;
    position: relative;
    min-height: 80px;
}

.header-content {
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.logo {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.8rem;
    font-weight: bold;
    color: #c78ce8;
    margin-bottom: 3px;
}

.tagline {
    font-size: 0.85rem;
    color: #e6d7ff;
    font-weight: 500;
    margin: 0 auto 8px auto;
    max-width: 300px;
    line-height: 1.2;
}

.subtitle {
    font-size: 0.9rem;
    color: #b8a5d1;
    font-style: italic;
    margin: -5px auto 0 auto;
    max-width: 300px;
    line-height: 1.4;
}

.header-controls {
    position: absolute;
    top: 15px;
    right: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.feedback-btn {
    background: rgba(46, 204, 113, 0.2);
    color: #2ecc71;
    border: 2px solid #2ecc71;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.feedback-btn:hover {
    background: #2ecc71;
    color: #1a0b2e;
}

.language-toggle {
    position: absolute;
    top: 15px;
    left: 10px;
}

.language-toggle button {
    background: rgba(184, 165, 209, 0.1);
    color: #b8a5d1;
    border: 1px solid rgba(184, 165, 209, 0.3);
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.language-toggle button:hover {
    background: rgba(184, 165, 209, 0.2);
    color: #c78ce8;
}

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

.feedback-modal-content {
    background: linear-gradient(135deg, #2d1b69, #1a0b2e);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.feedback-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.feedback-header h3 {
    margin: 0;
    color: #e6d7ff;
    font-size: 1.4rem;
}

.close-feedback-modal {
    background: none;
    border: none;
    color: #c78ce8;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-feedback-modal:hover {
    color: #e6d7ff;
}

.feedback-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feedback-type label,
.feedback-rating label,
.feedback-text label,
.feedback-email label {
    display: block;
    color: #e6d7ff;
    margin-bottom: 8px;
    font-weight: 500;
}

.feedback-type select {
    width: 100%;
    padding: 10px;
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 10px;
    color: #e6d7ff;
    font-size: 1rem;
}

.star-rating {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.star {
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.star.active,
.star:hover {
    opacity: 1;
}

.feedback-text textarea {
    width: 100%;
    padding: 12px;
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 10px;
    color: #e6d7ff;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.feedback-text textarea::placeholder {
    color: #b8a5d1;
}

.feedback-email input {
    width: 100%;
    padding: 10px;
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 10px;
    color: #e6d7ff;
    font-size: 1rem;
}

.feedback-email input::placeholder {
    color: #b8a5d1;
}

.submit-feedback-btn {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: center;
}

.submit-feedback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.submit-feedback-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Mobile responsiveness for feedback modal */
@media (max-width: 768px) {
    .feedback-modal-content {
        padding: 20px;
        margin: 20px;
    }

    .header-controls {
        flex-direction: column;
        gap: 5px;
    }

    .feedback-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

.mode-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
    margin-top: 60px;
}

.mode-btn {
    padding: 12px 20px;
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid rgba(199, 140, 232, 0.3);
    color: #c78ce8;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn.active {
    background: rgba(199, 140, 232, 0.2);
    border-color: #c78ce8;
}

.mode-btn:hover {
    background: rgba(199, 140, 232, 0.2);
}

.welcome-section {
    text-align: center;
    margin-bottom: 40px;
}

.welcome-section h2 {
    font-family: 'Comfortaa', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #e6d7ff;
}

.welcome-section p {
    color: #b8a5d1;
    font-size: 0.95rem;
}

.interpreters-section {
    margin-bottom: 30px;
    position: relative;
    width: 100%;
}

.interpreters-section h3 {
    text-align: center;
    margin: 0 0 20px 0;
    color: #e6d7ff;
    font-size: 1.2rem;
    width: 100%;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.interpreters {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.interpreter {
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid transparent;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 140px;
}

.interpreter.active {
    border-color: #c78ce8;
    background: rgba(199, 140, 232, 0.2);
}

.interpreter-avatar {
    font-size: 2rem;
    margin-bottom: 10px;
}

.interpreter h4 {
    color: #e6d7ff;
    margin-bottom: 5px;
}

.interpreter p {
    color: #b8a5d1;
    font-size: 0.8rem;
}

.dream-input-section {
    margin-bottom: 30px;
}

.dream-input-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #e6d7ff;
    font-size: 1.2rem;
}

.input-container {
    background: rgba(199, 140, 232, 0.1);
    border-radius: 15px;
    padding: 20px;
}

.dream-title-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 10px;
    padding: 12px 15px;
    color: #ffffff;
    font-size: 1rem;
    margin-bottom: 10px;
    font-weight: 500;
}

.dream-title-input::placeholder {
    color: #b8a5d1;
    font-style: italic;
}

.dream-title-input:focus {
    outline: none;
    border-color: #c78ce8;
}

#dreamText {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 10px;
    padding: 15px;
    color: #ffffff;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
}

#dreamText::placeholder {
    color: #b8a5d1;
}

#dreamText:focus {
    outline: none;
    border-color: #c78ce8;
}

.input-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.voice-btn, .interpret-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.save-interpretation-btn {
    width: 100%;
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.save-interpretation-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
    transform: translateY(-2px);
}

.save-interpretation-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.voice-btn {
    background: rgba(199, 140, 232, 0.2);
    color: #c78ce8;
    border: 2px solid #c78ce8;
}

.voice-btn:hover {
    background: #c78ce8;
    color: #1a0b2e;
}

.interpret-btn {
    background: linear-gradient(135deg, #c78ce8, #9b59b6);
    color: #ffffff;
}

.interpret-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(199, 140, 232, 0.4);
}

.result-section {
    margin-bottom: 30px;
}

.result-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #e6dff;
    font-size: 1.2rem;
}

.interpretation-card {
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 15px;
    padding: 20px;
}

.interpreter-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #b8a5d1;
}

.interpreter-name {
    font-weight: bold;
    color: #c78ce8;
}

.interpretation-text {
    color: #e6d7ff;
    line-height: 1.6;
}

.pricing-section {
    margin-bottom: 30px;
}

.pricing-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #e6d7ff;
    font-size: 1.2rem;
}

.pricing-cards {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.pricing-card {
    flex: 1;
    min-width: 140px;
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.pricing-card.featured {
    border-color: #c78ce8;
    background: rgba(199, 140, 232, 0.2);
}

.pricing-card h4 {
    color: #e6d7ff;
    margin-bottom: 10px;
}

.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #c78ce8;
    margin-bottom: 10px;
}

.pricing-card p {
    color: #b8a5d1;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.pricing-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #c78ce8, #9b59b6);
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pricing-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(199, 140, 232, 0.4);
}

.journal-section {
    margin-bottom: 30px;
}

.journal-section h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #e6d7ff;
    font-size: 1.2rem;
}

.journal-input {
    background: rgba(199, 140, 232, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

#journalDreamText {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 10px;
    padding: 15px;
    color: #ffffff;
    font-size: 1rem;
    resize: vertical;
    margin-bottom: 15px;
}

#journalDreamText::placeholder {
    color: #b8a5d1;
}

#journalDreamText:focus {
    outline: none;
    border-color: #c78ce8;
}

.journal-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.save-btn, .view-journal-btn {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.save-btn {
    background: linear-gradient(135deg, #c78ce8, #9b59b6);
    color: #ffffff;
}

.view-journal-btn {
    background: rgba(199, 140, 232, 0.2);
    color: #c78ce8;
    border: 2px solid #c78ce8;
}

.save-btn:hover, .view-journal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(199, 140, 232, 0.4);
}

.journal-entries {
    display: none;
}

.journal-entry {
    background: rgba(199, 140, 232, 0.1);
    border: 2px solid rgba(199, 140, 232, 0.3);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 10px;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.entry-date {
    color: #c78ce8;
    font-size: 0.8rem;
    font-weight: bold;
}

.delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.delete-btn:hover {
    background: rgba(231, 76, 60, 0.2);
}

.entry-title {
    color: #c78ce8;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.entry-text {
    color: #e6d7ff;
    line-height: 1.6;
}

.journal-empty {
    text-align: center;
    color: #b8a5d1;
    font-style: italic;
    padding: 40px 20px;
}

.usage-status {
    text-align: center;
    color: #c78ce8;
    font-size: 0.85rem;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: rgba(199, 140, 232, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(199, 140, 232, 0.3);
}

.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(199, 140, 232, 0.3);
    border-top: 4px solid #c78ce8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-spinner p {
    color: #c78ce8;
    font-size: 1.1rem;
    font-weight: 500;
}

/* Mobile-specific styles */
@media (max-width: 767px) {
    .header {
        padding: 10px 0;
        min-height: 70px;
    }
    
    .logo {
        font-size: 1.6rem;
    }
    
    .tagline {
        font-size: 0.8rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .language-toggle {
        left: 5px;
        top: 10px;
    }
    
    .language-toggle button {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .header-controls {
        right: 5px;
        top: 10px;
    }
    
    .feedback-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (min-width: 768px) {
    .app {
        max-width: 600px;
        padding: 30px;
    }

    .logo {
        font-size: 2rem;
    }
    
    .header {
        min-height: 90px;
    }
    
    .language-toggle {
        left: 20px;
    }
    
    .header-controls {
        right: 20px;
    }

    .welcome-section h2 {
        font-size: 1.8rem;
    }

    .interpreters {
        max-width: 320px;
        margin: 0 auto;
    }
}

.voice-recording {
    background: #e74c3c !important;
    animation: pulse 1s infinite;
}

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

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.save-interpretation-btn {
    margin-top: 15px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    width: 100%;
}

.save-interpretation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.saved-readings-section {
    text-align: center;
    margin-top: 20px;
}

.view-saved-btn {
    padding: 12px 30px;
    background: rgba(199, 140, 232, 0.2);
    color: #c78ce8;
    border: 2px solid #c78ce8;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.view-saved-btn:hover {
    background: #c78ce8;
    color: #1a0b2e;
}

.saved-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    z-index: 1000;
    overflow-y: auto;
}

.modal-content {
    background: linear-gradient(135deg, #1a0b2e, #16213e);
    margin: 20px auto;
    padding: 20px;
    border-radius: 15px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: #e6d7ff;
}

.close-modal {
    background: none;
    border: none;
    color: #c78ce8;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.saved-entry {
    background: rgba(199, 140, 232, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(199, 140, 232, 0.3);
}

.saved-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #b8a5d1;
}

.saved-dream, .saved-interpretation {
    margin-bottom: 10px;
    color: #e6d7ff;
    line-height: 1.5;
}

.saved-dream strong, .saved-interpretation strong {
    color: #c78ce8;
}

/* Payment Modal Styles */
.payment-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.payment-modal-content {
    background: linear-gradient(135deg, #2a1b3d 0%, #44318b 100%);
    margin: 5% auto;
    padding: 0;
    border: 2px solid #c78ce8;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(199, 140, 232, 0.3);
}

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(199, 140, 232, 0.3);
}

.payment-header h3 {
    color: #e6d7ff;
    margin: 0;
    font-size: 1.4rem;
}

.close-payment-modal {
    background: none;
    border: none;
    color: #c78ce8;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-payment-modal:hover {
    background-color: rgba(199, 140, 232, 0.2);
}

.payment-details {
    padding: 20px 25px;
    text-align: center;
    border-bottom: 1px solid rgba(199, 140, 232, 0.3);
}

.payment-details p {
    color: #e6d7ff;
    margin: 5px 0;
}

.payment-amount {
    font-size: 1.8rem;
    font-weight: bold;
    color: #c78ce8;
}

#payment-element {
    padding: 20px 25px;
}

.payment-buttons {
    padding: 20px 25px;
    text-align: center;
}

.payment-submit-btn {
    background: linear-gradient(135deg, #c78ce8 0%, #8b5fbf 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(199, 140, 232, 0.4);
}

.payment-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.payment-message {
    padding: 15px 25px;
    text-align: center;
    color: #ff6b6b;
    font-weight: 500;
}

.payment-message.hidden {
    display: none;
}

.spinner {
    color: #ffffff;
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
}

.spinner.hidden {
    display: none;
}

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

#button-text.hidden {
    display: none;
}