/* =================================================================
   Dreamscribe Web Hub - Main Stylesheet
   ================================================================= */

/* -----------------------------------------------------------------
   1. Base Styles & Typography
   ----------------------------------------------------------------- */

body {
    font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', serif;
}

/* -----------------------------------------------------------------
   2. Transitions & Animations
   ----------------------------------------------------------------- */

* {
    transition-property: color, background-color, border-color;
    transition-duration: 150ms;
    transition-timing-function: ease-in-out;
}

/* -----------------------------------------------------------------
   3. Focus States (Accessibility)
   ----------------------------------------------------------------- */

textarea:focus,
input:focus,
button:focus {
    outline: none;
    ring: 2px;
    ring-color: #8E7CC3;
    ring-opacity: 0.5;
}

/* -----------------------------------------------------------------
   4. Custom Scrollbar (Webkit)
   ----------------------------------------------------------------- */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f6f2f8;
}

::-webkit-scrollbar-thumb {
    background: #8E7CC3;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7a6ba8;
}

/* -----------------------------------------------------------------
   5. Audio & Media Elements
   ----------------------------------------------------------------- */

audio {
    filter: sepia(20%) saturate(70%) hue-rotate(220deg);
}

img {
    display: inline;
}

/* Footer logo inline display */
footer img {
    display: inline;
}

/* -----------------------------------------------------------------
   6. Placeholder Text
   ----------------------------------------------------------------- */

textarea::placeholder {
    transition: opacity 0.3s ease;
}

textarea:focus::placeholder {
    opacity: 0.5;
}

/* -----------------------------------------------------------------
   7. Markdown Content Styling
   ----------------------------------------------------------------- */

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child {
    margin-top: 0;
}

.markdown-content h1 {
    font-size: 1.875rem;
}

.markdown-content h2 {
    font-size: 1.5rem;
}

.markdown-content h3 {
    font-size: 1.25rem;
}

.markdown-content h4 {
    font-size: 1.125rem;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.markdown-content ul {
    list-style-type: disc;
}

.markdown-content ol {
    list-style-type: decimal;
}

.markdown-content li {
    margin-bottom: 0.25em;
}

.markdown-content li:last-child {
    margin-bottom: 0;
}

.markdown-content strong {
    font-weight: 600;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content blockquote {
    border-left: 4px solid #8E7CC3;
    padding-left: 1em;
    margin: 1.5em 0;
    color: rgba(46, 46, 56, 0.8);
}

.markdown-content code {
    background-color: rgba(142, 124, 195, 0.1);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

.markdown-content pre {
    background-color: rgba(142, 124, 195, 0.05);
    padding: 1em;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1em 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid rgba(142, 124, 195, 0.3);
    margin: 2em 0;
}

.markdown-content a {
    color: #8E7CC3;
    text-decoration: underline;
}

.markdown-content a:hover {
    color: #7a6ba8;
}

/* -----------------------------------------------------------------
   8. Modal Styles
   ----------------------------------------------------------------- */

/* Modal container */
.modal-container {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal backdrop */
.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(46, 46, 56, 0.7);
}

/* Modal content */
.modal-content {
    position: relative;
    background-color: #F6F2F8;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 42rem;
    width: 100%;
    margin: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(142, 124, 195, 0.2);
    max-height: 80vh;
    overflow-y: auto;
}

/* -----------------------------------------------------------------
   9. Form Elements
   ----------------------------------------------------------------- */

/* Custom select dropdown arrow */
.select-with-arrow {
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg width=%2712%27 height=%278%27 viewBox=%270 0 12 8%27 fill=%27none%27 xmlns=%27http://www.w3.org/2000/svg%27%3e%3cpath d=%27M1 1.5L6 6.5L11 1.5%27 stroke=%27%238E7CC3%27 stroke-width=%271.5%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27/%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px 8px;
    padding-right: 2.5rem;
}

/* -----------------------------------------------------------------
   10. Utility Classes
   ----------------------------------------------------------------- */

/* Deletion links */
.delete-link {
    color: #D97979;
}

.delete-link:hover {
    text-decoration: underline;
}

/* Tarot card aspect ratio */
.tarot-card-container {
    aspect-ratio: 0.5727;
}

/* Relaxed line height for interpretations */
.interpretation-text {
    line-height: 1.5rem;
}

/* Chat message auto-scroll container */
.chat-messages {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

/* Auto-expanding textarea max height */
.auto-expand-textarea {
    max-height: 120px;
}
