/* Floating launcher button (minimised state) */
.oda-chat-launcher {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #F8A8D8 0%, #D8A8F8 30%, #A8C8F8 60%, #62C5F7 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    cursor: pointer;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.oda-chat-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.oda-chat-launcher:active {
    transform: scale(0.95);
}

.oda-launcher-icon {
    font-size: 24px;
    line-height: 1;
}

/* Chat wrapper (container for the chat window) */
.oda-chat-wrapper {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    max-width: calc(100% - 40px);
    height: 700px;
    max-height: calc(100vh - 40px);
    min-width: 400px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-radius: 12px;
    background: #ffffff;
    z-index: 999999; /* Very high z-index to ensure it's on top */
    overflow: hidden;
    resize: both; /* Allow resizing on desktop */
    cursor: default;
}

/* Main chat container */
#oda-chat-container {
    max-width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    max-height: 100%;
    box-shadow: none;
    resize: none;
    overflow: hidden;
    position: relative;
    flex: 1;
}

/* Resize handle indicator at bottom-right corner of wrapper */
.oda-chat-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: linear-gradient(-45deg, transparent 30%, #999 30%, #999 35%, transparent 35%, transparent 65%, #999 65%, #999 70%, transparent 70%);
    cursor: nwse-resize;
    z-index: 10;
    pointer-events: auto;
    opacity: 0.5;
    transition: opacity 0.2s ease;
    border-radius: 0 0 12px 0;
}

.oda-chat-wrapper:hover::after {
    opacity: 1;
    background: linear-gradient(-45deg, transparent 30%, #666 30%, #666 35%, transparent 35%, transparent 65%, #666 65%, #666 70%, transparent 70%);
}

/* Enhanced resize handle for better visibility */
.oda-chat-wrapper:active::after {
    opacity: 1;
    background: linear-gradient(-45deg, transparent 30%, #333 30%, #333 35%, transparent 35%, transparent 65%, #333 65%, #333 70%, transparent 70%);
}

/* Old resize handle - removed, using wrapper::after instead */

.oda-chat-header {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: linear-gradient(135deg, #F8A8D8 0%, #D8A8F8 30%, #A8C8F8 60%, #62C5F7 100%);
    border-radius: 12px 12px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex-shrink: 0;
    cursor: move; /* Indicate draggable */
    user-select: none; /* Prevent text selection while dragging */
}

.oda-chat-header.dragging {
    cursor: grabbing;
}

.oda-chat-header.dragging * {
    pointer-events: none;
}

/* Prevent dragging on buttons and interactive elements */
.oda-icon-btn,
.oda-status-badge,
.oda-chat-logo {
    cursor: pointer;
    pointer-events: auto;
}

.oda-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

/* Ensure logo and title are aligned horizontally */
.oda-chat-header-left .oda-chat-logo {
    vertical-align: middle;
    align-self: center;
}

.oda-chat-header-left .oda-chat-title {
    vertical-align: middle;
    align-self: center;
}

.oda-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Minimize and close buttons - small utility icons */
.oda-icon-btn {
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0;
    margin: 0;
    opacity: 0.8;
}

.oda-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    opacity: 1;
}

.oda-icon-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.95);
}

.oda-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(248, 168, 216, 0.1) 0%, rgba(216, 168, 248, 0.15) 30%, rgba(168, 200, 248, 0.15) 60%, rgba(98, 197, 247, 0.1) 100%);
    z-index: 0;
}

.oda-chat-header > * {
    position: relative;
    z-index: 1;
}

.oda-chat-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
}

.oda-chat-title {
    flex: 1;
    margin: 0;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
    line-height: 1.3;
    display: flex;
    align-items: center;
}

.oda-status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.oda-status-badge.trial {
    background: rgba(255, 255, 255, 0.9);
    color: #d63384;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.oda-status-badge.trial.expired {
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    animation: pulse 2s infinite;
}

.oda-status-badge.active {
    background: #FBD5D8; /* Custom color for ACTIVE badge */
    color: #333; /* Dark text for readability */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Status label styling based on state */
.oda-status-label {
    display: inline-block;
    font-weight: 600;
}

.oda-status-badge.package.active .oda-status-label {
    color: #155724; /* Dark green for ACTIVE */
}

.oda-status-badge.trial .oda-status-label {
    color: #856404; /* Dark yellow for TRIAL */
}

.oda-status-badge.expired .oda-status-label {
    color: #721c24; /* Dark red for EXPIRED */
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.oda-chat-toolbar {
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    background: #f8f9fa;
    align-items: center;
    flex-shrink: 0;
}

.oda-format-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

.oda-format-select:hover {
    border-color: #4F46E5;
}

.oda-format-select:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.oda-chat-header {
    position: relative;
}

.oda-menu-toggle {
    display: none; /* Hidden on desktop */
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    margin-left: auto;
}

.oda-options-panel {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 15px;
    min-width: 200px;
    z-index: 1000;
    margin-top: 5px;
}

.oda-options-panel.show {
    display: block;
}

.oda-provider-select,
.oda-mode-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.oda-provider-select:hover,
.oda-mode-select:hover {
    border-color: #bbb;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.oda-provider-select:focus,
.oda-mode-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.oda-btn {
    padding: 7px 15px;
    border: 1px solid #ddd;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #333;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.oda-btn-secondary {
    background: #E5E7EB; /* Gray 200 */
    color: #111827; /* Gray 900 */
    border-color: #E5E7EB;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
}

.oda-btn-secondary:hover:not(:disabled) {
    background: #D1D5DB; /* Gray 300 */
    border-color: #D1D5DB;
}

.oda-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #bbb;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.oda-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.oda-btn-clear {
    background: #F6A8BF; /* Custom color for CLEAR button */
    color: #333; /* Dark text for readability */
    border-color: #F6A8BF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
}

.oda-btn-clear:hover:not(:disabled) {
    background: #f59ab0; /* Slightly darker on hover (5-10% darker) */
    border-color: #f48ba1;
    color: #333;
    box-shadow: 0 4px 8px rgba(246, 168, 191, 0.3);
}

.oda-btn-export {
    background: #B3C5E6; /* Custom color for EXPORT button */
    color: #333; /* Dark text for readability */
    border-color: #B3C5E6;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
}

.oda-btn-export:hover:not(:disabled) {
    background: #a2b5d9; /* Slightly darker on hover */
    border-color: #91a5cc;
    color: #333;
    box-shadow: 0 4px 8px rgba(179, 197, 230, 0.3);
}

.oda-btn-upload {
    background: #BBD2DE; /* Custom color for UPLOAD FILE button */
    color: #333; /* Dark text for readability */
    border-color: #BBD2DE;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
    padding: 7px 15px;
    font-size: 12px;
}

.oda-btn-upload:hover:not(:disabled) {
    background: #aac5d3; /* Slightly darker on hover */
    border-color: #99b8c8;
    color: #333;
    box-shadow: 0 4px 8px rgba(187, 210, 222, 0.3);
}

.oda-btn-primary {
    background: #4F46E5; /* Indigo 600 - tier 3-4 color */
    color: #fff;
    border-color: #4F46E5;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 14px;
    transition: all 0.2s;
}

.oda-btn-primary:hover:not(:disabled) {
    background: #4338CA; /* Indigo 700 */
    border-color: #4338CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.oda-chat-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    padding-bottom: 100px; /* Reserve space for input area on mobile */
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 0; /* Allow flex shrinking */
}

.oda-message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s;
}

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

.oda-message.user {
    flex-direction: row-reverse;
}

.oda-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F8A8D8 0%, #62C5F7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.oda-message.user .oda-message-avatar {
    background: linear-gradient(135deg, #62C5F7 0%, #F8A8D8 100%);
}

.oda-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    background: #ffeef5; /* Light pink background */
    color: #000; /* Black text */
    position: relative;
    border: 1px solid #ffd0e5;
}

.oda-message.user .oda-message-content {
    background: #007cba;
    color: #fff;
    border-color: #005a87;
}

.oda-message-content pre {
    background: rgba(0,0,0,0.1);
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.oda-message.user .oda-message-content pre {
    background: rgba(255,255,255,0.2);
}

.oda-message-content code {
    background: rgba(0,0,0,0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.oda-message.user .oda-message-content code {
    background: rgba(255,255,255,0.2);
}

.oda-message-content img {
    max-width: 100%;
    border-radius: 4px;
    margin: 10px 0;
}

/* Image thumbnails in messages */
.oda-message-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.oda-file-image-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.oda-message-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

.oda-message-image:hover {
    transform: scale(1.05);
}

.oda-image-thumbnail-actions {
    position: absolute;
    top: 4px;
    right: 4px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.oda-file-image-wrapper:hover .oda-image-thumbnail-actions {
    opacity: 1;
}

.oda-btn-thumbnail-download,
.oda-btn-thumbnail-delete {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.oda-btn-thumbnail-download:hover {
    background: rgba(0, 0, 0, 0.9);
}

.oda-btn-thumbnail-delete:hover {
    background: rgba(220, 53, 69, 0.9);
}

/* Pasted image preview */
.oda-pasted-image-preview {
    margin: 8px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.oda-image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.oda-pasted-image {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    border-radius: 8px;
    cursor: pointer;
    display: block;
}

.oda-image-preview-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.oda-image-preview-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.oda-message-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.oda-message:hover .oda-message-actions {
    opacity: 1;
}

.oda-btn-copy,
.oda-btn-delete {
    padding: 6px 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.oda-btn-copy:hover {
    background: #e3f2fd;
    border-color: #2196f3;
    transform: scale(1.05);
}

.oda-btn-copy.copied {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}

.oda-btn-delete:hover {
    background: #ffebee;
    border-color: #f44336;
    transform: scale(1.05);
}

.oda-message.user .oda-message-actions .oda-btn-copy,
.oda-message.user .oda-message-actions .oda-btn-delete {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.oda-message.user .oda-message-actions .oda-btn-copy:hover {
    background: rgba(255, 255, 255, 0.3);
}

.oda-message.user .oda-message-actions .oda-btn-delete:hover {
    background: rgba(255, 82, 82, 0.3);
    border-color: rgba(255, 82, 82, 0.5);
}

.oda-chat-input-area {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 10;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
}

.oda-chat-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.oda-chat-input-row-top {
    margin-bottom: 8px;
}

/* File previews in messages */
.oda-message-files {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.oda-file-image-wrapper {
    position: relative;
    display: inline-block;
    max-width: 200px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
}

.oda-message-image {
    max-width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.2s;
}

.oda-message-image:hover {
    transform: scale(1.05);
}

.oda-file-name {
    padding: 4px 8px;
    font-size: 11px;
    color: #666;
    background: rgba(0, 0, 0, 0.05);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.oda-file-item-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f0f0f0;
    border-radius: 6px;
    font-size: 12px;
    color: #333;
    border: 1px solid #e0e0e0;
}

.oda-file-icon {
    font-size: 14px;
}

/* Pasted image preview in input area */
.oda-pasted-image-preview {
    margin: 10px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ccc;
}

.oda-image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 300px;
}

.oda-pasted-image {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

.oda-image-preview-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.oda-btn-edit-image,
.oda-btn-remove-preview {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.oda-btn-edit-image:hover {
    background: #e3f2fd;
    border-color: #2196f3;
}

.oda-btn-remove-preview:hover {
    background: #ffebee;
    border-color: #f44336;
}

.oda-image-preview-hint {
    margin-top: 8px;
    font-size: 11px;
    color: #666;
    font-style: italic;
}

.oda-btn-upload-icon {
    background: #E5E7EB;
    color: #374151;
    border: none;
    border-radius: 999px;
    padding: 10px;
    cursor: pointer;
    font-size: 18px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.oda-btn-upload-icon:hover:not(:disabled) {
    background: #D1D5DB;
    transform: translateY(-1px);
}

.oda-btn-upload-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.oda-provider-icon {
    background: #E5E7EB;
    color: #374151;
    border: none;
    border-radius: 999px;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.oda-provider-icon:hover {
    background: #D1D5DB;
}

.oda-provider-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px;
    min-width: 200px;
    z-index: 100;
}

.oda-provider-popup.show {
    display: block;
}

.oda-btn-send-icon {
    background: #4F46E5;
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 18px;
    min-width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.oda-btn-send-icon:hover:not(:disabled) {
    background: #4338CA;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.3);
}

.oda-btn-send-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.oda-upload-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.oda-image-mode-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 7px 11px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 12px;
    transition: all 0.2s;
}

.oda-image-mode-toggle:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.oda-image-mode-toggle input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.oda-btn-generate-image {
    background: transparent; /* Loại bỏ nền */
    color: #333; /* Dark text for readability */
    border-color: #9DD3AF;
    border: 1px solid #9DD3AF;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 120px;
    padding: 7px 15px;
    border-radius: 6px;
    font-size: 12px;
}

.oda-btn-generate-image:hover:not(:disabled) {
    background: rgba(157, 211, 175, 0.1); /* Light background on hover */
    border-color: #7bb58f;
    color: #333;
    box-shadow: 0 2px 4px rgba(157, 211, 175, 0.2);
}

.oda-file-context-option {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}

.oda-file-context-option label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

.oda-file-context-option input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.oda-generated-image {
    margin: 15px 0;
    text-align: center;
    max-width: 100%;
}

.oda-generated-image img,
.oda-image-thumbnail,
.oda-pasted-image,
.oda-edited-image,
.oda-message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.oda-generated-image img:hover,
.oda-image-thumbnail:hover,
.oda-pasted-image:hover,
.oda-edited-image:hover,
.oda-message-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Image popup/modal */
.oda-image-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: fadeIn 0.2s ease;
}

.oda-image-popup.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.oda-image-popup-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.oda-image-popup img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    object-fit: contain;
}

.oda-image-popup-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 1000001;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.oda-image-popup-close:hover {
    background: #fff;
    transform: scale(1.1);
}

.oda-image-popup-close:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    /* Full screen chat on mobile - prioritize chat content display */
    .oda-chat-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-width: 100% !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
        transform: none !important;
        resize: none !important;
    }
    
    #oda-chat-container {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .oda-chat-messages {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 15px 10px;
        padding-bottom: 120px; /* Reserve space for sticky input */
        min-height: 0;
        max-height: none; /* Remove max-height restriction */
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better image display on mobile */
    .oda-message-image {
        max-width: 150px;
        max-height: 150px;
    }
    
    .oda-pasted-image {
        max-width: 200px;
        max-height: 200px;
    }
    
    /* Show thumbnail actions on mobile (always visible) */
    .oda-image-thumbnail-actions {
        opacity: 1;
        background: rgba(0, 0, 0, 0.5);
        padding: 4px;
        border-radius: 4px;
    }
    
    .oda-image-popup {
        padding: 10px;
    }
    
    .oda-image-popup-content {
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .oda-image-popup img {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .oda-image-popup-close {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}

.oda-image-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
    padding: 10px 0;
    /* Ensure actions are always visible - not cut off by container */
    position: relative;
    z-index: 1;
}

.oda-btn-download-image,
.oda-btn-copy-image-url {
    padding: 6px 12px;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.oda-btn-download-image:hover,
.oda-btn-copy-image-url:hover {
    background: #5a6268;
}

.oda-btn-copy-image-url.copied {
    background: #28a745;
}

.oda-file-upload-area {
    margin-bottom: 10px;
}

.oda-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.oda-file-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.oda-file-item-remove {
    cursor: pointer;
    color: #dc3545;
    font-weight: bold;
}

#oda-message-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
}

#oda-message-input:focus {
    outline: none;
    border-color: #007cba;
}

#oda-send-btn {
    margin-top: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #e91e63 0%, #c2185b 50%, #ad1457 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

#oda-send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

#oda-send-btn:hover:not(:disabled)::before {
    left: 100%;
}

#oda-send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #c2185b 0%, #ad1457 50%, #880e4f 100%);
    box-shadow: 0 6px 16px rgba(233, 30, 99, 0.5);
    transform: translateY(-2px);
}

#oda-send-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(233, 30, 99, 0.4);
}

#oda-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.oda-trial-expired-banner {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe0e0 50%, #ffcccc 100%);
    border-left: 4px solid #dc3545;
    padding: 20px 24px;
    margin: 0;
    animation: slideDown 0.5s ease;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oda-banner-content {
    text-align: center;
    max-width: 100%;
}

.oda-banner-content h4 {
    margin: 0 0 8px 0;
    color: #dc3545;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.oda-banner-content p {
    margin: 0 0 16px 0;
    color: #721c24;
    font-size: 14px;
    line-height: 1.5;
}

.oda-btn-upgrade {
    display: inline-block;
    padding: 14px 35px;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff1744 100%);
    color: #fff !important;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 200px;
}

.oda-btn-upgrade:hover {
    background: linear-gradient(135deg, #ff1744 0%, #ff6b35 50%, #f7931e 100%);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.5);
    transform: translateY(-3px);
    color: #fff !important;
}

/* Package activation confirmation */
.oda-package-confirmation {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 50%, #b1dfbb 100%);
    border-left: 4px solid #28a745;
    padding: 20px 24px;
    margin: 0;
    animation: slideDown 0.5s ease;
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
    position: relative;
    z-index: 1;
    width: 100%;
    box-sizing: border-box;
}

.oda-confirmation-content {
    text-align: center;
    position: relative;
}

.oda-confirmation-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.oda-confirmation-content h4 {
    margin: 0 0 8px 0;
    color: #155724;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.oda-confirmation-content p {
    margin: 0 0 4px 0;
    color: #155724;
    font-size: 14px;
    line-height: 1.5;
}

.oda-expiration-info {
    color: #155724 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    margin-top: 8px !important;
}

.oda-btn-close-confirmation {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    color: #155724;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.oda-btn-close-confirmation:hover {
    opacity: 1;
}

.oda-error-message {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    margin: 20px;
    border: 1px solid #f5c6cb;
    text-align: center;
    font-size: 14px;
}

.oda-login-required {
    padding: 40px 20px;
    text-align: center;
}

.oda-login-required p {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

.oda-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #666;
}

.oda-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive - Mobile Optimization */
/* Pasted image preview styles */
.oda-pasted-image-preview {
    margin: 15px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    border: 2px dashed #ddd;
}

.oda-image-preview-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.oda-pasted-image {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.oda-image-preview-actions {
    margin-top: 10px;
    text-align: center;
}

.oda-btn-edit-image,
.oda-btn-remove-preview {
    padding: 8px 16px;
    margin: 0 5px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.oda-btn-edit-image {
    background: #2196f3;
    color: #fff;
}

.oda-btn-edit-image:hover {
    background: #1976d2;
}

.oda-btn-remove-preview {
    background: #f44336;
    color: #fff;
}

.oda-btn-remove-preview:hover {
    background: #d32f2f;
}

.oda-image-preview-hint {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Image edit UI */
.oda-image-edit-ui {
    margin-top: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.oda-image-edit-prompt label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.oda-edit-prompt-input {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.oda-edit-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.oda-btn-apply-edit,
.oda-btn-cancel-edit {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.oda-btn-apply-edit {
    background: #4caf50;
    color: #fff;
}

.oda-btn-apply-edit:hover:not(:disabled) {
    background: #45a049;
}

.oda-btn-apply-edit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.oda-btn-cancel-edit {
    background: #f5f5f5;
    color: #333;
}

.oda-btn-cancel-edit:hover {
    background: #e0e0e0;
}

/* Edited image result */
.oda-edited-image-result {
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 8px;
    border: 2px solid #4caf50;
}

.oda-edited-image-result h4 {
    margin: 0 0 15px 0;
    color: #2e7d32;
}

.oda-edited-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.oda-paste-success {
    border-color: #4caf50 !important;
    background: #e8f5e9 !important;
}

/* Toolbar layout */
.oda-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.oda-left-tools,
.oda-right-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.oda-btn-success {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.oda-btn-success:hover:not(:disabled) {
    background: #45a049;
}

.oda-btn-success:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Image mode panel styles (legacy - keep for backward compatibility) */
.oda-image-mode-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.oda-image-mode-switch {
    display: flex;
    gap: 4px;
    background: #f5f5f5;
    padding: 3px;
    border-radius: 6px;
}

.oda-image-mode-switch label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 11px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 12px;
    margin: 0;
}

.oda-image-mode-switch label input[type="radio"] {
    margin-right: 5px;
    margin-left: 0;
}

.oda-image-mode-switch label span {
    font-size: 12px;
}

.oda-image-mode-switch label:hover {
    background: #e0e0e0;
}

.oda-image-mode-switch label:has(input[type="radio"]:checked) {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.oda-image-mode-switch label input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2196f3;
}

.oda-mode-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 5px 11px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 12px;
}

.oda-mode-option input[type="radio"] {
    margin-right: 6px;
}

.oda-mode-option:hover {
    background: #e0e0e0;
}

.oda-mode-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #2196f3;
}

.oda-mode-option:has(input[type="radio"]:checked) {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.oda-provider-info {
    font-size: 12px;
    color: #666;
    padding: 4px 8px;
    background: #f0f0f0;
    border-radius: 4px;
}

.oda-provider-label {
    font-weight: 500;
}

/* Hide/show utility */
.oda-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    /* Launcher on mobile - only show when chat is hidden */
    .oda-chat-launcher {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
        z-index: 999998;
    }
    
    /* Chat wrapper on mobile - full screen for maximum chat content display */
    .oda-chat-wrapper {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-width: 100% !important;
        min-height: 100vh !important;
        border-radius: 0 !important; /* Full screen - no border radius */
        z-index: 999999 !important; /* Ensure highest z-index on mobile */
        transform: none !important; /* Disable transform on mobile */
        resize: none !important; /* Disable resize on mobile */
        overflow: hidden;
    }
    
    /* Hide resize handle on mobile (not needed for full screen) */
    .oda-chat-wrapper::after {
        display: none !important;
    }
    
    /* Disable drag on mobile */
    .oda-chat-header {
        cursor: default;
    }
    
    #oda-chat-container {
        margin: 0;
        border-radius: 0;
        height: 100vh !important; /* Full viewport height */
        min-height: 100vh !important;
        max-height: 100vh !important;
        max-width: 100%;
        resize: none;
        position: relative;
        padding: 0;
        box-sizing: border-box;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
    
    .oda-chatbot-header-title {
        font-size: 16px;
    }
    
    .oda-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .oda-left-tools,
    .oda-right-tools {
        width: 100%;
        justify-content: flex-start;
    }
    
    #oda-generate,
    #oda-upload {
        width: 100%;
    }
    
    .oda-chat-header,
    .oda-chat-input-area {
        flex-direction: column;
        align-items: stretch;
    }
    
    .oda-chat-header > *,
    .oda-chat-input-area > * {
        width: 100%;
        box-sizing: border-box;
    }
    
    #oda-message-input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    #oda-chat-container::after {
        display: none; /* Hide resize handle on mobile */
    }
    
    .oda-chat-header {
        padding: 10px 12px;
        border-radius: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .oda-chat-header-left {
        gap: 10px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }
    
    .oda-chat-actions {
        flex-shrink: 0;
        gap: 2px;
        margin-left: 8px;
    }
    
    .oda-icon-btn {
        width: 22px;
        height: 22px;
        font-size: 14px;
        padding: 0;
        min-width: 22px;
    }
    
    .oda-chat-logo {
        width: 32px;
        height: 32px;
    }
    
    .oda-chat-title {
        font-size: 10px;
    }
    
    .oda-status-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .oda-chat-toolbar {
        flex-wrap: wrap;
        padding: 8px 10px;
        gap: 6px;
    }
    
    .oda-provider-select,
    .oda-mode-select,
    .oda-format-select {
        font-size: 12px;
        padding: 6px 8px;
        flex: 1;
        min-width: 0;
    }
    
    .oda-btn-clear,
    .oda-btn-export {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 80px;
        flex: 1;
    }
    
    .oda-message-content {
        max-width: 85%;
        font-size: 14px;
        padding: 10px 12px;
    }
    
    .oda-message-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .oda-chat-messages {
        padding: 15px 10px;
        padding-bottom: 120px; /* Reserve space for sticky input area */
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        min-height: 0; /* Allow flex shrinking */
        max-height: none; /* Remove max-height restriction on mobile */
    }
    
    .oda-chat-input-area {
        padding: 10px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        position: sticky;
        bottom: 0;
        z-index: 10;
        background: #f8f9fa;
        box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    }
    
    .oda-upload-controls {
        gap: 6px;
        margin-bottom: 8px;
        flex-wrap: wrap;
    }
    
    .oda-btn-upload {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 100px;
        flex: 1;
    }
    
    .oda-image-mode-toggle {
        font-size: 12px;
        padding: 6px 10px;
        flex: 1;
        min-width: 0;
    }
    
    .oda-btn-generate-image {
        font-size: 11px;
        padding: 6px 10px;
        min-width: 100px;
        flex: 1;
    }
    
    .oda-file-context-option {
        padding: 8px;
        font-size: 12px;
    }
    
    #oda-message-input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px;
        min-height: 50px;
        max-height: 150px;
        border-radius: 8px;
        width: 100%;
        box-sizing: border-box;
        resize: vertical;
    }
    
    .oda-package-confirmation {
        padding: 15px 20px;
        margin: 0;
    }
    
    .oda-confirmation-content h4 {
        font-size: 16px;
    }
    
    .oda-confirmation-content p {
        font-size: 13px;
    }
    
    .oda-confirmation-icon {
        font-size: 28px;
    }
    
    .oda-btn-close-confirmation {
        top: 4px;
        right: 8px;
        font-size: 20px;
        padding: 2px 6px;
    }
    
    .oda-package-confirmation {
        padding: 15px 20px;
        margin: 0;
    }
    
    .oda-confirmation-content h4 {
        font-size: 16px;
    }
    
    .oda-confirmation-content p {
        font-size: 13px;
    }
    
    .oda-confirmation-icon {
        font-size: 28px;
    }
    
    .oda-btn-close-confirmation {
        top: 4px;
        right: 8px;
        font-size: 20px;
        padding: 2px 6px;
    }
    
    #oda-send-btn {
        margin-top: 0;
        padding: 12px 16px;
        font-size: 14px;
        min-height: 48px; /* Better touch target */
        width: 100%;
        display: block;
        box-sizing: border-box;
        flex-shrink: 0;
    }
    
    .oda-file-list {
        gap: 6px;
    }
    
    .oda-file-item {
        font-size: 11px;
        padding: 3px 6px;
    }
    
    .oda-message-actions {
        gap: 6px;
    }
    
    .oda-btn-copy,
    .oda-btn-delete {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .oda-generated-image img {
        border-radius: 6px;
    }
    
    .oda-image-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .oda-btn-download-image,
    .oda-btn-copy-image-url {
        font-size: 11px;
        padding: 8px 12px;
        flex: 1;
        min-width: 100px;
        min-height: 44px; /* Better touch target */
    }
    
    .oda-trial-expired-banner {
        padding: 15px 20px;
        margin: 0;
    }
    
    .oda-banner-content h4 {
        font-size: 16px;
    }
    
    .oda-banner-content p {
        font-size: 13px;
    }
    
    .oda-btn-upgrade {
        padding: 12px 20px;
        font-size: 14px;
        min-width: 150px;
        width: 100%;
        min-height: 44px; /* Better touch target */
    }
    
    /* Ensure all interactive elements have proper touch targets */
    .oda-btn,
    .oda-provider-select,
    .oda-mode-select,
    .oda-format-select,
    .oda-image-mode-toggle {
        min-height: 44px; /* Apple's recommended touch target size */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Prevent text selection on buttons */
    .oda-btn,
    .oda-btn-upload,
    .oda-btn-generate-image,
    .oda-btn-clear,
    .oda-btn-export {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Improve scrolling on mobile */
    .oda-chat-messages {
        -webkit-overflow-scrolling: touch;
        overflow-scrolling: touch;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .oda-chat-header {
        padding: 10px 12px;
    }
    
        .oda-chat-title {
            font-size: 10px;
        }
    
    .oda-status-badge {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .oda-chat-toolbar {
        padding: 6px 8px;
    }
    
    .oda-provider-select,
    .oda-mode-select,
    .oda-format-select {
        font-size: 11px;
        padding: 5px 6px;
    }
    
    .oda-btn-clear,
    .oda-btn-export {
        font-size: 10px;
        padding: 5px 8px;
        min-width: 70px;
    }
    
    .oda-upload-controls {
        flex-direction: column;
        gap: 6px;
    }
    
    .oda-btn-upload,
    .oda-image-mode-toggle,
    .oda-btn-generate-image {
        width: 100%;
        min-width: 100%;
    }
    
    .oda-message-content {
        max-width: 90%;
        font-size: 13px;
        padding: 8px 10px;
    }
    
    #oda-send-btn {
        font-size: 13px;
        padding: 10px;
        min-height: 44px; /* Better touch target */
    }
    
    .oda-chat-messages {
        padding: 10px 8px;
    }
    
    /* Stack upload controls vertically on very small screens */
    .oda-upload-controls {
        flex-direction: column;
    }
    
    .oda-btn-upload,
    .oda-image-mode-toggle,
    .oda-btn-generate-image {
        width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for touch devices */
    .oda-btn,
    .oda-provider-select,
    .oda-mode-select,
    .oda-format-select {
        min-height: 48px;
        padding: 12px 16px;
    }
    
    .oda-message-actions .oda-btn-copy,
    .oda-message-actions .oda-btn-delete {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .oda-btn:hover:not(:disabled),
    .oda-provider-select:hover,
    .oda-mode-select:hover {
        transform: none;
    }
}

