/* ================================================
   FloorAssistant - Application Styles
   Production-Ready CSS with Cognito Authentication
   ================================================ */

/* Hide screens by default - ADDED FOR MACHINE CONTEXT */
.password-change-screen,
.chat-screen {
    display: none;
}

/* ================================================
   FloorAssistant - Application Styles
   Production-Ready CSS with Cognito Authentication
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body and general text */
body {
    font-family: 'Inter', sans-serif; /* Change from system fonts to Inter */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
}

/* Headings / Titles */
h1, h2, h3, h4, .title {
    font-family: 'Montserrat', sans-serif; /* Use Montserrat for headings */
    font-weight: 700; /* Bold / strong */
    margin: 0;
}
.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 900px;
    width: 100%;
    overflow: hidden;
}

/* ================================================
   LOGIN SCREEN
   ================================================ */

.login-screen {
    padding: 60px 40px;
    text-align: center;
}

.logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-screen h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 32px;
}

.login-screen p {
    color: #666;
    margin-bottom: 40px;
    font-size: 16px;
}

.login-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.login-btn:hover {
    transform: translateY(-2px);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message, .info-message {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

.error-message {
    background: #fee;
    color: #c33;
}

.info-message {
    background: #e3f2fd;
    color: #1976d2;
}

/* ================================================
   PASSWORD CHANGE SCREEN
   ================================================ */

.password-change-screen {
    display: none;
    padding: 60px 40px;
    text-align: center;
}

/* ================================================
   CHAT INTERFACE
   ================================================ */
.chat-screen {
    display: none;
    height: 700px;
    flex-direction: column;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.user-info {
    font-size: 14px;
    opacity: 0.9;
}

.header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.language-selector {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.language-selector option {
    color: #333;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.message {
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
}

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

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.assistant .message-avatar {
    background: #e0e0e0;
}

.message-content {
    max-width: 70%;
    padding: 15px;
    border-radius: 15px;
    line-height: 1.6;
}

.message.user .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 85%;
}

.message-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 5px;
}

.action-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* ================================================
   MEDIA SOURCES - FULL WIDTH DISPLAY
   ================================================ */

.message-sources {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.sources-title {
    font-weight: 600;
    margin-bottom: 12px;
    color: #667eea;
    font-size: 14px;
}

/* Media Item Container - Full Width Display */
.media-item {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    background: #f8f9fa;
}

.media-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Image Display - Full Width */
.media-item img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    object-fit: contain;
    background: #000;
}

/* Video Display - Full Width */
.media-item video {
    width: 100%;
    height: auto;
    display: block;
    max-height: 400px;
    background: #000;
}

/* Media Caption */
.media-caption {
    padding: 10px;
    font-size: 13px;
    color: #666;
    background: #f8f9fa;
}

.media-caption .media-icon {
    margin-right: 6px;
}

/* ================================================
   LIGHTBOX MODAL
   ================================================ */

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    cursor: pointer;
    animation: fadeIn 0.2s;
}

.lightbox-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

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

.lightbox-content {
    max-width: 95%;
    max-height: 95%;
    position: relative;
    animation: zoomIn 0.2s;
}

@keyframes zoomIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: white;
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.source-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s;
}

.source-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.source-icon {
    font-size: 24px;
}

.source-info {
    flex: 1;
    min-width: 0;
}

.source-name {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.typing-indicator {
    display: none;
    padding: 15px;
    background: white;
    border-radius: 15px;
    width: fit-content;
}

.typing-indicator span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    margin: 0 2px;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-10px); }
}

.chat-input-container {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    max-height: 120px;
}

.chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.input-actions {
    display: flex;
    gap: 8px;
}

.voice-btn, .send-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.voice-btn {
    background: #4CAF50;
    color: white;
}

.voice-btn:hover {
    transform: scale(1.1);
}

.voice-btn.listening {
    background: #f44336;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.send-btn:hover {
    transform: scale(1.1);
}

.send-btn:disabled, .voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

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

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

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .container {
        max-width: 100%;
        border-radius: 0;
        height: 100vh;
    }

    .chat-screen {
        height: 100vh;
    }

    .login-screen,
    .password-change-screen {
        padding: 40px 20px;
    }

    .message-content {
        max-width: 85%;
    }

    .media-item img,
    .media-item video {
        max-height: 300px;
    }

    .lightbox-content img,
    .lightbox-content video {
        max-height: 80vh;
    }

    .sources-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   MACHINE SWITCH CONFIRMATION ANIMATIONS
   ================================================ */

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

@keyframes toastSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastSlideDown {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(100px);
    }
}
/* ============================================
   MACHINE CONTEXT BAR - NEW STYLES
   Add these to your existing app.css
   ============================================ */
/* Hide screens by default */
.password-change-screen,
.chat-screen {
    display: none;
}

/* Machine Context Bar */
.machine-context-bar {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.machine-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.machine-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.machine-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.machine-name {
    font-size: 15px;
    color: white;
    font-weight: 700;
    line-height: 1.2;
}

.machine-change-btn {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    min-height: 36px;
    min-width: 70px;
}

.machine-change-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.machine-change-btn:active {
    transform: translateY(0);
}

/* Machine Selector Modal */
.machine-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.machine-selector-modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

.machine-selector-header {
    text-align: center;
    margin-bottom: 24px;
}

.machine-selector-icon {
    font-size: 3em;
    margin-bottom: 12px;
}

.machine-selector-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.machine-selector-subtitle {
    font-size: 0.95em;
    color: #666;
}

.machine-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.machine-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
}

.machine-option:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateX(4px);
}

.machine-option.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: white;
}

.machine-option-icon {
    font-size: 2em;
    line-height: 1;
}

.machine-option-details {
    flex: 1;
}

.machine-option-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 4px;
}

.machine-option.selected .machine-option-name {
    color: white;
}

.machine-option-type {
    font-size: 0.85em;
    color: #666;
}

.machine-option.selected .machine-option-type {
    color: rgba(255, 255, 255, 0.9);
}

.machine-selector-actions {
    display: flex;
    gap: 12px;
}

.machine-selector-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    min-height: 48px;
    transition: all 0.2s;
}

.machine-selector-cancel {
    background: #f5f5f5;
    color: #666;
}

.machine-selector-cancel:hover {
    background: #e0e0e0;
}

.machine-selector-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.machine-selector-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.machine-selector-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

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

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

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .machine-context-bar {
        padding: 10px 16px;
    }
    
    .machine-icon {
        font-size: 20px;
    }
    
    .machine-label {
        font-size: 10px;
    }
    
    .machine-name {
        font-size: 13px;
    }
    
    .machine-change-btn {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .machine-selector-modal {
        padding: 20px;
    }
    
    .machine-option {
        padding: 12px;
    }
}

