@import url('https://fonts.googleapis.com/css2?family=UnifrakturCook:wght@700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=MedievalSharp&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pirata+One&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap');

body {
    font-family: sans-serif;
    margin: 0;
    padding: 20px;
    background: url('../assets/images/background.jpg') center center / cover no-repeat fixed;
    color: #e6dff0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    justify-content: flex-start;
    /* Grainy overlay */
    position: relative;
}
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2P4//8/AwAI/AL+Qn1vAAAAAElFTkSuQmCC'); /* tiny grain PNG */
    background-repeat: repeat;
    /* Subtle vignette for depth */
    box-shadow: 0 0 200px rgba(0, 0, 0, 0.2) inset;
}

/* Remove the water reflection effect since we're using the actual image */
body::after {
    display: none;
}

h1 {
    font-family: 'Pirata One', 'MedievalSharp', 'UnifrakturCook', cursive, serif;
    font-size: 3em;
    color: #4a0e67; /* Deep purple */
    margin-bottom: 30px;
    letter-spacing: 2px;
    text-shadow: 2px 2px 8px #e6dff0, 0 0 2px #7e439c;
    text-align: center;
}

/* Main title - "NeoTarot" */
.main-title {
    /* Original font (pirate/medieval style): */
    /* font-family: 'Pirata One', 'MedievalSharp', 'UnifrakturCook', cursive, serif; */
    
    /* New font (elegant/mystical style): */
    font-family: 'Cinzel', serif;
    font-size: 4.5em;
    color: #f0e6ff;
    margin-bottom: 10px;
    margin-top: 20px;
    letter-spacing: 3px;
    text-shadow: 
        0 0 5px rgba(240, 230, 255, 0.25),
        0 0 10px rgba(240, 230, 255, 0.15),
        2px 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center;
    font-weight: 700;
}

/* Subtitle - "AI Powered Tarot Card Reader" */
.subtitle {
    font-family: 'MedievalSharp', serif;
    font-size: 1.2em;
    color: #e6dff0;
    margin-bottom: 40px;
    margin-top: 0;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
    text-align: center;
    font-style: italic;
    opacity: 0.9;
}

#controls {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column; /* Stack sections vertically */
    gap: 20px; /* Space between sections */
    margin-left: auto;
    margin-right: auto;
    width: 100%; /* Allow full width */
    max-width: none !important; /* Remove any max-width constraints */
}

/* Question section - same width as controls */
#controls > div:first-child { 
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 1200px !important;
    max-width: none !important;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    box-sizing: border-box;
    text-align: left; /* Left justify the question section */
}

/* Bottom controls section - flex row for remaining controls */
.bottom-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start; /* Align to top instead of bottom */
    justify-content: flex-start; /* Left align bottom controls */
    padding: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    max-width: 800px !important;
    width: 90% !important;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    text-align: left; /* Left justify all text content */
}

/* Button within bottom controls should align with other elements */
.bottom-controls #start-reading-btn {
    align-self: flex-start;
    margin-top: auto;
    height: fit-content;
}

#controls > div:not(:first-child) { /* Other control groups */
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
    text-align: left; /* Left align control group content */
    align-items: flex-start; /* Ensure flex items are left-aligned */
}

/* Ensure all elements within bottom controls are left-aligned */
.bottom-controls > div {
    text-align: left;
    align-items: flex-start;
}

.bottom-controls label,
.bottom-controls select,
.bottom-controls button,
.bottom-controls small {
    text-align: left;
}

#controls label {
    font-weight: bold;
    color: #5a2a69; /* Purple to match heading */
    margin: 0; /* Remove all margins */
    padding: 0; /* Remove any padding */
    width: 100%; /* Ensure label spans full width too */
    display: block; /* Make sure it's a block element */
}

#controls select,
#controls button {
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1em;
}

#controls select {
    min-width: 200px; /* Give selects a decent width */
}

#controls button {
    background-color: #7e439c; /* Brighter purple for button */
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    align-self: flex-end; /* Align button to the bottom of its flex container if wrapped */
}

#controls button:hover {
    background-color: #5a2a69; /* Darker purple on hover */
}

#restart-btn {
    background-color: #7e439c;
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    margin-right: 10px;
    transition: background-color 0.3s ease;
}
#restart-btn:hover {
    background-color: #5a2a69;
}

.user-guidance-message {
    margin: 20px 0;
    padding: 15px;
    background-color: #e6dff0; /* Lighter purple for guidance */
    border: 1px solid #c8bfe0;
    border-radius: 8px;
    text-align: center;
    font-style: italic;
    color: #4a0e67;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

#card-selection-area,
#card-selection-area.fan-mode,
#card-selection-area.stacked-deck {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block;
}

#card-selection-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    background-color: rgba(255, 255, 255, 0.5); /* Slight white transparency */
}

#card-selection-area.fan-mode {
    position: fixed;
    left: 0;
    right: 0;
    top: 420px;
    height: 200px;
    min-width: 100vw;
    width: 100vw !important;
    display: block;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    margin: 0 !important;
    z-index: 10;
}

.fan-mode .card-back {
    margin-left: 0 !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: auto;
    transition: transform 0.3s;
    pointer-events: auto;
}

.card-back {
    width: 100px; /* Smaller for selection */
    height: 170px; /* Maintain aspect ratio */
    background-image: url('../assets/back/back1.jpg');
    background-size: cover;
    background-position: center;
    border: 2px solid #4a0e67;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 0.9em;
    text-align: center;
    padding: 5px;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-left: 0;
    z-index: 1;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8); /* Add text shadow to make text readable on any background */
}

.card-back:hover {
    z-index: 10;
    transform: translateY(-5px);
    box-shadow: 4px 4px 10px rgba(0,0,0,0.3);
}

.card-back.selected {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #888;
    filter: grayscale(100%); /* Add grayscale effect to selected cards */
}

#card-display-area {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
    width: 90%;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.card {
    width: 160px; /* Slightly larger than selection backs */
    height: 280px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 3px 3px 7px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Distribute space */
    align-items: center;
    padding: 10px;
    text-align: center;
}

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

.card-image {
    max-width: 90%;
    max-height: 70%; /* Allow more space for image */
    object-fit: contain; /* Ensure image fits well */
    margin-bottom: 10px;
}

.card-name {
    font-weight: bold;
    font-size: 0.9em;
    color: #4a0e67;
}

#interpretation-area {
    margin-top: 20px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    width: 95%;
    max-width: 1400px;
    min-height: 0;
    background: rgba(123, 66, 156, 0.85); /* semi-transparent purple */
    border: none;
    margin-left: auto;
    margin-right: auto;
    display: block;
}
#interpretation-area h3, #interpretation-area ul {
    background: #bba0d3;
    border-radius: 8px;
    padding: 10px;
}

#interpretation-area h3 {
    color: #4a0e67;
    text-align: center;
    margin-bottom: 15px;
}

#interpretation-area ul {
    list-style-type: none;
    padding: 0;
}

#interpretation-area li {
    background-color: #f9f6fc; /* Very light lavender for list items */
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 5px;
    border-left: 4px solid #7e439c;
}

#interpretation-area li strong {
    color: #5a2a69;
}

#interpretation-area, #interpretation-area h3, #interpretation-area ul, #interpretation-area li, #interpretation-area li strong {
    color: #000 !important;
}

#interpretation-area li {
    background-color: #f9f6fc;
    color: #000 !important;
}

#interpretation-area li strong {
    color: #000 !important;
}

#card-selection-area.overlap-cards {
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: unset;
    padding-left: 0;
}

#footer-copyright {
    width: 100%;
    text-align: center;
    font-size: 0.95em;
    color: #7e439c;
    margin-top: 40px;
    margin-bottom: 10px;
    opacity: 0.7;
    letter-spacing: 1px;
}

#footer-copyright {
    margin-top: auto;
}

#card-selection-area.stacked-deck {
    position: relative;
    height: 200px;
    min-width: 0;
    width: fit-content;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    margin-left: auto;
    margin-right: auto;
    left: unset;
    transform: unset;
}
.stacked-deck .card-back.stacked {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    z-index: 1;
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1), opacity 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
    /* All cards perfectly overlap */
    transform: translateX(0) translateY(0) rotate(0deg);
    opacity: 1;
}
.fan-mode .card-back {
    transition: transform 0.7s cubic-bezier(0.4, 0.2, 0.2, 1), opacity 0.7s cubic-bezier(0.4, 0.2, 0.2, 1);
}
.fan-mode .card-back.stacked {
    /* Remove stacked effect when fanning */
    z-index: auto;
}

#card-selection-area:empty {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
}

#interpretation-area:empty {
    display: none !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
}

.card-position {
    color: #000 !important;
    text-shadow: none !important;
}

/* Performance and SEO optimized styles */

/* Skip link for accessibility and SEO */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #2a003f;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus {
    top: 6px;
}

/* Header and navigation styles */
header[role="banner"] {
    background: linear-gradient(135deg, #2a003f 0%, #4a0e4e 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(42, 0, 63, 0.3);
}

nav[role="navigation"] ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

nav[role="navigation"] a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav[role="navigation"] a:hover,
nav[role="navigation"] a:focus {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Main content spacing */
main {
    padding: 2rem 1rem;
    max-width: 1600px !important;
    margin: 0 auto;
}

/* Intro text styling */
.intro-text {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem auto;
    color: #2a003f;
    font-size: 1.15em;
    line-height: 1.6;
}

/* Help text for form elements */
small {
    display: block;
    color: #666;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

/* About tarot section */
#about-tarot {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#about-tarot h2 {
    color: #2a003f;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2.25rem;
}

#about-tarot h3 {
    color: #4a0e4e;
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

#about-tarot p {
    line-height: 1.7;
    color: #333;
    margin-bottom: 1rem;
}

#about-tarot ul {
    padding-left: 1.5rem;
}

#about-tarot li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #333;
}

/* Footer improvements */
footer[role="contentinfo"] {
    background: none;
    color: #7e439c;
    text-align: center;
    padding: 0;
    margin-top: 3rem;
}

#footer-links {
    margin-bottom: 1rem;
}

#footer-links a {
    color: #7e439c;
    text-decoration: none;
    margin: 0 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s ease;
}

#footer-links a:hover,
#footer-links a:focus {
    background: rgba(126, 67, 156, 0.1);
}

/* Enhanced controls for question input and LLM selection */
#controls textarea {
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #ddd;
    font-size: 1.1em;
    font-family: inherit;
    resize: vertical;
    width: 100%; /* Full width within container */
    min-height: 120px; /* Larger to span top half */
    text-align: left;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    margin: 0; /* Remove any margins */
}

#controls textarea:focus {
    outline: 2px solid #7e439c;
    outline-offset: 2px;
    border-color: #7e439c;
}

/* AI Reading Display Styles */
.reading-header {
    background: linear-gradient(135deg, #7e439c 0%, #5a2a69 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    text-align: center;
}

.reading-header h2 {
    margin: 0 0 1rem 0;
    font-size: 2rem;
}

.reading-meta {
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.reading-meta p {
    margin: 0.5rem 0;
    line-height: 1.5;
}

.cards-drawn {
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #e0e0e0;
}

.cards-drawn h3 {
    color: #4a0e67;
    margin-top: 0;
    margin-bottom: 1rem;
    text-align: center;
}

.card-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.card-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #7e439c;
}

.card-thumbnail {
    width: 50px;
    height: 85px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

.card-info {
    flex: 1;
}

.card-info strong {
    color: #4a0e67;
    font-size: 0.9rem;
}

.card-name {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
}

.ai-interpretation {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.ai-interpretation h3 {
    color: #4a0e67;
    margin-top: 0;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
}

.interpretation-text {
    line-height: 1.7;
    color: #333;
    font-size: 1rem;
}

.interpretation-text p {
    margin-bottom: 1rem;
}

.interpretation-text strong {
    color: #4a0e67;
}

/* Error message styling */
.error-message {
    background: #ffebee;
    border: 1px solid #f44336;
    color: #c62828;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.error-message h3 {
    color: #c62828;
    margin-top: 0;
}

/* LLM Selection Button Styling */
.llm-select-button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left; /* Ensure text is left-aligned */
}

.llm-select-button:hover {
    border-color: #7e439c;
    box-shadow: 0 2px 8px rgba(126, 67, 156, 0.2);
}

.dropdown-arrow {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.llm-select-button.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* Modal Overlay and Base Styling - Enhanced specificity */
#llm-modal.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#llm-modal.modal-overlay.show {
    display: flex !important;
    opacity: 1;
}

#llm-modal .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    color: white;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

#llm-modal.modal-overlay.show .modal-content {
    transform: scale(1);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

.modal-header h2 {
    color: white;
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
}

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

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Modal Body */
.modal-body {
    padding: 0 24px 24px 24px;
}

.modal-subtitle {
    color: #bbb;
    margin: 0 0 24px 0;
    font-size: 1rem;
    line-height: 1.5;
}

/* Provider Sections */
.provider-section {
    margin-bottom: 32px;
}

.provider-section:last-child {
    margin-bottom: 0;
}

.provider-title {
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Model Grid */
.model-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 12px;
}

/* Model Cards - Enhanced specificity */
#llm-modal .model-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #1f1f32 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
    margin-bottom: 12px !important;
}

#llm-modal .model-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(126, 67, 156, 0.1) 0%, rgba(90, 42, 105, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#llm-modal .model-card:hover {
    border-color: #7e439c !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 25px rgba(126, 67, 156, 0.3) !important;
}

#llm-modal .model-card:hover::before {
    opacity: 1;
}

#llm-modal .model-card.selected {
    border-color: #7e439c !important;
    background: linear-gradient(135deg, #7e439c 0%, #5a2a69 100%) !important;
    box-shadow: 0 4px 20px rgba(126, 67, 156, 0.4) !important;
}

#llm-modal .model-card.selected::before {
    opacity: 0;
}

#llm-modal .model-name {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: white !important;
    margin-bottom: 8px !important;
    position: relative !important;
    z-index: 1 !important;
}

#llm-modal .model-description {
    font-size: 0.9rem !important;
    color: #bbb !important;
    line-height: 1.4 !important;
    position: relative !important;
    z-index: 1 !important;
}

#llm-modal .model-card.selected .model-description {
    color: #e6dff0 !important;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 24px 24px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-save-btn, .modal-cancel-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-save-btn {
    background: linear-gradient(135deg, #7e439c 0%, #5a2a69 100%);
    color: white;
}

.modal-save-btn:hover {
    background: linear-gradient(135deg, #8f4fad 0%, #6b3b7a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(126, 67, 156, 0.4);
}

.modal-cancel-btn {
    background: transparent;
    color: #bbb;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-cancel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Responsive Design for Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        padding: 20px 20px 0 20px;
    }
    
    .modal-body {
        padding: 0 20px 20px 20px;
    }
    
    .modal-footer {
        padding: 16px 20px 20px 20px;
        flex-direction: column;
    }
    
    .model-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-header h2 {
        font-size: 1.5rem;
    }
    
    .llm-select-button {
        min-width: 100%;
    }
}

/* Animation for modal cards */
@keyframes modalCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-overlay.show .model-card {
    animation: modalCardFadeIn 0.4s ease forwards;
}

.modal-overlay.show .model-card:nth-child(1) { animation-delay: 0.1s; }
.modal-overlay.show .model-card:nth-child(2) { animation-delay: 0.2s; }
.modal-overlay.show .model-card:nth-child(3) { animation-delay: 0.3s; }

/* Responsive adjustments */
@media (max-width: 768px) {
    nav[role="navigation"] ul {
        gap: 1rem;
        justify-content: space-around;
    }
    
    nav[role="navigation"] a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .intro-text {
        font-size: 1.05em;
        padding: 0 1rem;
    }
    
    /* Mobile responsive title styles */
    .main-title {
        font-size: 3em;
        margin-bottom: 8px;
        margin-top: 15px;
        letter-spacing: 2px;
    }
    
    .subtitle {
        font-size: 1em;
        margin-bottom: 30px;
        padding: 0 1rem;
    }
    
    #about-tarot {
        margin: 2rem 0;
        padding: 1.5rem;
    }
    
    #about-tarot h2 {
        font-size: 1.875rem;
    }
    
    #footer-links a {
        margin: 0 0.5rem;
        display: inline-block;
    }
    
    #controls textarea {
        width: 100%;
        margin: 0;
    }
    
    /* Adjust question section for mobile */
    #controls > div:first-child {
        width: 98%; /* Nearly full width on mobile */
        max-width: none; /* Remove max-width constraint on mobile */
        padding: 15px; /* Slightly less padding on mobile */
    }
    
    /* Stack bottom controls vertically on mobile */
    .bottom-controls {
        flex-direction: column;
        width: 98%; /* Match question section width on mobile */
        max-width: none; /* Remove max-width constraint on mobile */
        text-align: left; /* Ensure left alignment on mobile */
        align-items: stretch; /* Stretch items to full width when stacked */
        gap: 15px;
    }
    
    .bottom-controls > div {
        min-width: 100%;
        text-align: left; /* Force left alignment on mobile */
        align-items: flex-start; /* Left align flex items on mobile */
    }
    
    .bottom-controls label,
    .bottom-controls select,
    .bottom-controls button,
    .bottom-controls small {
        text-align: left; /* Force left alignment for all elements on mobile */
    }
    
    .card-summary {
        grid-template-columns: 1fr;
    }
    
    .card-item {
        flex-direction: column;
        text-align: center;
    }
    
    .card-thumbnail {
        width: 60px;
        height: 102px;
    }
    
    .reading-header h2 {
        font-size: 1.5rem;
    }
    
    .reading-meta {
        font-size: 0.9rem;
    }
}

/* Focus management for accessibility */
*:focus {
    outline: 2px solid #2a003f;
    outline-offset: 2px;
}

/* Loading states for better UX */
.loading {
    opacity: 0.7;
    pointer-events: none;
} 

/* CSS Test - This should make model cards very obvious */
.model-card {
    background: red !important;
    border: 5px solid yellow !important;
    padding: 20px !important;
    margin: 10px !important;
    color: white !important;
    border-radius: 10px !important;
    cursor: pointer !important;
}

/* Model Cards - Enhanced specificity */
#llm-modal .model-card {
    background: linear-gradient(135deg, #2a2a3e 0%, #1f1f32 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 12px !important;
    padding: 20px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
    margin-bottom: 12px !important;
} 