:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-color: #f5f6fa;
    --text-color: #2c3e50;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem 3rem;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.version-tag {
    position: absolute;
    top: 0;
    right: 0;

.processing-message {
    margin-top: 10px;
    color: #666;
    font-style: italic;
    font-size: 0.9em;
}

    color: #666;
    font-size: 0.8rem;
}

.upload-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.chat-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.events-display {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.event-card {
    border-left: 4px solid var(--secondary-color);
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 4px;
}

.button {
    background-color: var(--secondary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    margin: 0 auto;
    display: block;
}

.button:hover {
    background-color: #2980b9;
}

.button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.button-danger {
    background-color: var(--accent-color);
}

.button-danger:hover {
    background-color: #c0392b;
}

.input-field {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.processing-indicator {
    display: none;
    text-align: center;
    margin: 1rem 0;
    color: var(--secondary-color);
}

#promptErrorContainer {
    margin-top: 1rem;
    display: none;
    text-align: left;
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
}

.hidden {
    display: none !important;
}

.loading-spinner {
    display: none;
    text-align: center;
    margin: 1rem 0;
}

.chat-messages {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.message {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
}

.message.user {
    background-color: #e3f2fd;
    margin-left: 20%;
}

.message.system {
    background-color: #f5f5f5;
    margin-right: 20%;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

.action-buttons {
    display: none;
    justify-content: space-between;
    margin-top: 1rem;
}
.calendar-request {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.request-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.original-image-container {
    flex: 0 0 auto;
    width: 100%;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.original-text-container {
    padding: 1rem;
    background: var(--background-color);
    border-radius: 4px;
    width: 100%;
}

.image-preview-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-preview-wrapper:hover {
    transform: scale(1.05);
}

.preview-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (min-width: 768px) {
    .request-details {
        flex-direction: row;
        gap: 2rem;
        align-items: flex-start;
    }

    .original-image-container {
        flex: 0 0 auto;
        width: auto;
    }

    .original-text-container {
        flex: 1;
        min-width: 0;
    }
}

.image-upload-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin: 1rem 0;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.image-preview-item img {
    border-radius: 8px;
    overflow: hidden;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-item:hover {
    transform: scale(1.05);
}

.remove-image {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 2;
}

.remove-image i {
    font-size: 12px;
}

.remove-image:hover {
    background: rgba(231, 76, 60, 1);
}

@media (max-width: 768px) {
    .remove-image {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: -6px;
        right: -6px;
    }
}

.upload-counter {
    text-align: center;
    color: #666;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.upload-limit-warning {
    color: #e74c3c;
    text-align: center;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}


.image-preview {
    position: relative;
    display: inline-block;
}


.example-response,
.example-corrections,
.example-final {
    margin-top: 1.5rem;
    text-align: left;
}

.correction-text {
    background: #f5f5f5;
    padding: 0.5rem;
    border-radius: 4px;
    font-style: italic;
}

.example-modal-content .event-card {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.example-modal-content h3 {
    margin-top: 0;
    color: var(--primary-color);
}

.thumbnail {
    max-width: 300px;
    max-height: 200px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.2s;
}

.thumbnail:hover {
    transform: scale(1.05);
}

.image-preview-item img,
.image-preview-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.data-disclaimer {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-top: 1rem;
}

.data-disclaimer a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.data-disclaimer a:hover {
    text-decoration: underline;
}

.terms-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 0.5rem;
    text-align: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 999;
}

/* Ensure Lightbox2 appears above everything */
.lb-overlay, #lightbox, .lightbox {
    z-index: 9999 !important;
}

.lb-dataContainer, .lb-outerContainer {
    z-index: 10000 !important;
}

.terms-text {
    font-size: 0.85rem;
    color: var(--text-color);
    margin: 0;
    text-align: center;
}

.terms-text a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* Modal styles now handled by Lightbox2 */

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 2rem;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 800px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body {
    margin-top: 1rem;
    line-height: 1.6;
}

.modal-body h2 {
    color: var(--primary-color);
    margin: 0.5rem 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-body p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.modal-body ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.modal-body li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.modal-body strong {
    color: var(--primary-color);
    font-weight: 600;
}

.modal-body a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.modal-body a:hover {
    color: #2980b9;
    text-decoration: underline;
}


/* Scrollbar styling for modal content */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

.modal h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.upload-instruction {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    text-align: center;
}

.upload-instruction a {
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: 500;
}

.upload-instruction a:hover {
    text-decoration: underline;
}

.example-modal-content {
    text-align: center;
    padding: 1rem;
}

.example-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.example-prompt {
    background: #f5f5f5;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}