:root {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --accent-color: #01BF70;
    --button-hover: #FFC600;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    margin-left: 60px;
}

h1 {
    color: var(--text-color);
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

p {
    color: #cccccc;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: var(--button-hover);
}

footer {
    padding: 1.5rem;
    text-align: center;
    background-color: #242424;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    color: #888;
}

footer a {
    color: var(--accent-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.logo {
    width: 180px;
    height: 60px;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.logo img {
    width: 100%;
    height: 100%;
}

.video-preview {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 320px;
    height: 180px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    background-color: #000;
    z-index: 1000;
    transform: translateY(200%);
    transition: transform 0.3s ease-out;
    border: 2px solid var(--accent-color);
}

.video-preview.active {
    transform: translateY(0);
}

.video-preview:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    transform: translateY(-5px);
}

.video-active .content {
    margin-right: initial;
}

.video-controls {
    display: none;
    margin-top: 1rem;
}

.video-controls button {
    margin: 0 0.5rem;
}

.upload-section {
    padding: 20px;
    padding-top: 0;
}

.upload-section h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.url-input {
    padding: 0.8rem;
    border-radius: 4px;
    border: 1px solid #444;
    background: #333;
    color: white;
    width: 100%;
}

.url-input:focus {
    outline: 2px solid var(--accent-color);
    border-color: transparent;
}

.result-section {
    display: none;
    margin-top: 20px;
    padding: 15px;
    background: #242424;
    border-radius: 8px;
    color: #fff;
}

.result-section.visible {
    display: block;
}

.result-image {
    max-width: 200px;
    border-radius: 4px;
    margin-bottom: 1rem;
}

#resultText {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    color: #ddd;
    margin: 0;
    padding: 10px;
    background: #333;
    border-radius: 4px;
}

.file-input-wrapper {
    border: 2px dashed #444;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    margin: 20px 0;
    transition: border-color 0.3s ease;
}

.file-input-wrapper:hover {
    border-color: #ff6b00;
}

.file-input-wrapper input[type="file"] {
    display: none;
}

.file-input-wrapper label {
    cursor: pointer;
    color: #666;
}

.preview-container {
    display: none;
    margin: 20px 0;
}

.preview-container.visible {
    display: block;
}

.preview-container img {
    max-width: 100%;
    border-radius: 8px;
}

/* Sidebar styles */
.sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    width: 320px;
    height: 100vh;
    background: var(--bg-color);
    color: var(--text-color);
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease-in-out;
    z-index: 998;
    padding-top: 80px;
}

.sidebar.open {
    transform: translateX(320px);
}

.sidebar-toggle {
    position: fixed;
    left: 20px;
    top: 20px;
    color: var(--text-color);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    visibility: hidden;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
}

.sidebar-toggle svg {
    fill: var(--text-color);
}

/* Update sidebar toggle styles */
.sidebar-toggle .close-icon {
    display: none;
}

.sidebar-toggle.open .menu-icon {
    display: none;
}

.sidebar-toggle.open .close-icon {
    display: block;
}

/* Ensure sidebar background matches theme */
.sidebar {
    background: var(--bg-color);
    color: var(--text-color);
}

/* Chat styles */
.chat-container {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    background: #242424;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chat-container.active {
    display: block;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.chat-message {
    margin-bottom: 1rem;
    max-width: 80%;
    opacity: 0;
    transform: translateY(20px);
    animation: messageAppear 0.3s ease forwards;
    position: relative;
    z-index: 1;
}

.chat-message.agent {
    align-self: flex-start;
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message .message-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    word-wrap: break-word;
}

.chat-message.agent .message-content {
    background: #333;
    color: white;
    border-radius: 12px 12px 12px 0;
}

.chat-message.user .message-content {
    background: var(--accent-color);
    color: white;
    border-radius: 12px 12px 0 12px;
    flex-direction: row-reverse; /* Move speaker icon to the left */
}

.chat-message.user .message-content p {
    margin: 0;
}

.chat-status {
    padding: 0.5rem;
    border-top: 1px solid #333;
    display: none;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
    justify-content: flex-start;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: typing 1s infinite;
    opacity: 0.4;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-4px); opacity: 1; }
}

@keyframes messageAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #242424;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}

/* Cart Dialog Styles */
.cart-dialog {
    padding: 0;
    border: none;
    border-radius: 12px;
    background: var(--bg-color);
    color: var(--text-color);
    max-width: 800px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.cart-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #242424;
    border-radius: 12px 12px 0 0;
}

.cart-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-dialog {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* Cart table styles */
.cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1rem 0;
    background: #242424;
    border-radius: 8px;
    overflow: hidden;
}

.cart-table th {
    background: #333;
    padding: 1rem;
    font-weight: 500;
    text-align: left;
    border-bottom: 2px solid #444;
}

.cart-table td {
    padding: 1rem;
    border-bottom: 1px solid #333;
    vertical-align: middle;
}

.cart-table tr:last-child td {
    border-bottom: none;
}

.quantity-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
    height: 36px;
}

.quantity-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 16px;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background: var(--button-hover);
}

.quantity {
    min-width: 2rem;
    text-align: center;
    font-size: 1rem;
}

.notes-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #444;
    border-radius: 4px;
    background: #333;
    color: var(--text-color);
    height: 36px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.notes-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.delete-icon {
    color: #ff4444;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.delete-icon:hover {
    color: #ff6666;
}

/* Cart message specific styles */
.cart-message {
    width: 100% !important;
    max-width: 100% !important;
    background: var(--bg-color) !important;
    padding: 1rem !important;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin: 1rem 0 !important;
    flex: 1 1 100% !important;
}

.cart-view {
    width: 100%;
}

.cart-view h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.cart-table {
    width: 100%;
    margin-bottom: 0;
}

/* Remove the old dialog styles */
.cart-dialog {
    display: none;
}

/* Ensure all table cells have consistent padding */
.cart-table td > * {
    margin: 0;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .content {
        padding: 1rem;
        margin-left: 0;
    }

    .video-active .content {
        margin-right: 0;
    }

    .video-preview {
        position: fixed;
        width: 160px;
        height: 90px;
        right: 10px;
        bottom: 10px;
        margin: 0;
        z-index: 1000;
    }

    .chat-container {
        width: 100%;
        margin: 1rem 0;
    }

    .chat-messages {
        height: 60vh;
    }

    .chat-message .message-content {
        max-width: 90%;
    }

    /* Cart in chat styles for mobile */
    .cart-message {
        width: 100% !important;
        padding: 0.5rem !important;
    }

    .cart-table {
        font-size: 0.9rem;
    }

    .cart-table th,
    .cart-table td {
        padding: 0.5rem;
    }

    .quantity-cell {
        flex-direction: row;
        gap: 0.25rem;
    }

    .quantity-btn {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
    }

    .notes-input {
        width: calc(100% - 1rem);
        font-size: 0.9rem;
    }

    .delete-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }

    /* Sidebar adjustments for mobile */
    .sidebar {
        width: 100%;
        left: -100%;
    }

    .sidebar.open {
        transform: translateX(100%);
    }

    .sidebar-toggle {
        z-index: 1002;
    }
}

/* New item row styles */
.new-item-row {
    background: rgba(1, 191, 112, 0.1);
    animation: fadeIn 0.3s ease;
}

.item-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #444;
    border-radius: 4px;
    background: #333;
    color: var(--text-color);
    height: 36px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.item-input:focus {
    border-color: var(--accent-color);
    outline: none;
}

.add-icon {
    color: var(--accent-color);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: color 0.2s;
}

.add-icon:hover {
    color: var(--button-hover);
}

.add-item-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.2s;
}

.add-item-btn:hover {
    background: var(--button-hover);
}

/* Update empty cart style */
.empty-cart {
    text-align: center;
    padding: 2rem;
    color: #666;
    margin-bottom: 0;
}

.add-new-item {
    margin-top: 1rem;
    text-align: right;
    padding: 0 1rem;
}

.add-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.add-new-btn:hover {
    background: var(--button-hover);
}

.add-new-btn svg {
    width: 20px;
    height: 20px;
}

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

/* Order Process Styles */
.order-process {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1rem;
}

.order-section {
    background: #242424;
    border-radius: 8px;
    padding: 1.5rem;
}

.order-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-size: 1.2rem;
}

.location-field {
    margin-bottom: 1rem;
}

.location-field label {
    display: block;
    margin-bottom: 0.5rem;
    color: #888;
}

.location-input-group {
    display: flex;
    gap: 0.5rem;
}

.location-field input {
    flex: 1;
    padding: 0.8rem;
    border: 1px solid #444;
    border-radius: 4px;
    background: #333;
    color: var(--text-color);
}

.location-btn {
    padding: 0.5rem;
    background: var(--accent-color);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.location-btn:hover {
    background: var(--button-hover);
}

.fee-details {
    background: #333;
    border-radius: 4px;
    padding: 1rem;
}

.fee-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #444;
}

.fee-row:last-child {
    border-bottom: none;
}

.fee-row.total {
    font-weight: bold;
    color: var(--accent-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid #444;
}

.confirm-order-btn {
    width: 100%;
    padding: 1rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.confirm-order-btn:hover {
    background: var(--button-hover);
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .order-process {
        padding: 0.5rem;
        gap: 1rem;
    }

    .order-section {
        padding: 1rem;
    }
}

.location-map {
    height: 200px;
    width: 100%;
    margin-top: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
    transition: height 0.3s ease;
    cursor: pointer;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .location-map {
        height: 150px;
    }
}

/* Order Confirmation Styles */
.order-confirmation {
    transition: opacity 0.3s ease;
}

.loading-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    transition: opacity 0.3s ease;
}

.circular {
    animation: rotate 2s linear infinite;
    height: 50px;
    width: 50px;
}

.path {
    stroke: var(--accent-color);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.order-details {
    animation: fadeIn 0.3s ease;
}

.order-status {
    text-align: center;
    margin-bottom: 2rem;
}

.order-id {
    color: #888;
    margin-top: 0.5rem;
}

.delivery-map {
    height: 200px;
    width: 100%;
    border-radius: 8px;
    margin: 1rem 0;
    overflow: hidden;
}

.courier-info {
    background: #333;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.courier-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.courier-avatar {
    width: 50px;
    height: 50px;
    border-radius: 25px;
    object-fit: cover;
}

.courier-name {
    font-weight: 500;
    margin: 0;
}

.courier-rating {
    color: #888;
    margin: 0.2rem 0 0 0;
}

.delivery-timeline {
    margin-top: 2rem;
}

.timeline-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.timeline-item.active {
    opacity: 1;
}

.timeline-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
    border-radius: 20px;
}

.timeline-text {
    flex: 1;
}

.timeline-title {
    margin: 0;
    font-weight: 500;
}

.timeline-time {
    margin: 0.2rem 0 0 0;
    color: #888;
    font-size: 0.9rem;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: #888;
}

.speaker-icon {
    width: 25px;
    height: 25px;
    object-fit: contain;
    vertical-align: middle;
    opacity: 0.7;
    order: -1;
    transform: scaleX(-1);
    background: var(--accent-color);
    padding: 4px;
    border-radius: 50%;
}

/* Update speaker icon container */
.speaker-container {
    display: flex;
    align-items: center;
}

/* Add loading spinner styles */
.loading-message {
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.7;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Connection success message */
.connection-success {
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.connection-success svg {
    width: 20px;
    height: 20px;
}

/* Ensure chat messages don't affect container width */
.chat-messages {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.chat-message {
    max-width: 80%;
    position: relative;
    z-index: 1;
}

/* Ensure cart template stays full width */
#cartTemplate {
    width: 95% !important;
    max-width: 100% !important;
}

.cart-view {
    width: 100%;
}

.cart-message {
    width: 100% !important;
    max-width: 100% !important;
    margin: 1rem 0 !important;
    flex: 1 1 100% !important;
}

/* Ensure cart content takes full width */
#cartContent {
    width: 100%;
}

/* Make table take full width */
#cartContent table {
    width: 100%;
    table-layout: fixed;
}

/* Reset max-width for cart messages */
.chat-message.agent .cart-message {
    max-width: 100% !important;
    align-self: stretch !important;
}
