/* chat/assets/css/client-chat.css */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #333;
    --border-color: #ddd;
    --background-color: #f5f5f5;
    --client-message-bg: #667eea;
    --staff-message-bg: #e0e0e0;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: var(--background-color);
    color: var(--text-color);
}

/* ===== FORM SECTION ===== */
.form-section {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.form-container {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 600;
}

.header p {
    color: #666;
    font-size: 14px;
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
    font-size: 13px;
    color: #1565c0;
    line-height: 1.6;
}

.info-box strong {
    color: #0d47a1;
    display: block;
    margin-bottom: 8px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    line-height: 1.5;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    margin-top: 20px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px;
    border-radius: 6px;
    margin-top: 15px;
    font-size: 14px;
    display: none;
    border-left: 4px solid #f44336;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== CHAT SECTION ===== */
.chat-section {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: white;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.header-content h2 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
}

.header-content p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-close:active {
    transform: scale(0.95);
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-window::-webkit-scrollbar {
    width: 8px;
}

.chat-window::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-window::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.chat-window::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Message styling */
.message {
    display: flex;
    animation: slideIn 0.3s ease;
    margin-bottom: 10px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message.system {
    justify-content: center;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 8px;
    word-wrap: break-word;
    line-height: 1.4;
}

.message.sent .message-content {
    background: var(--client-message-bg);
    color: white;
    border-bottom-right-radius: 2px;
}

.message.received .message-content {
    background: var(--staff-message-bg);
    color: var(--text-color);
    border-bottom-left-radius: 2px;
}

.message.system .message-content {
    background: #fff3cd;
    color: #856404;
    font-size: 13px;
    font-style: italic;
    padding: 8px 12px;
    max-width: 90%;
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 4px;
}

/* ===== CHAT INPUT AREA ===== */
.chat-input-area {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

#messageInput {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    transition: border-color 0.3s;
}

#messageInput:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-send {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
    align-self: flex-end;
    flex-shrink: 0;
}

.btn-send:hover {
    background: var(--secondary-color);
}

.btn-send:active {
    transform: scale(0.98);
}

.btn-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .form-container {
        padding: 30px 20px;
        border-radius: 0;
    }
    
    .header h1 {
        font-size: 22px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .header-content h2 {
        font-size: 18px;
    }
    
    .chat-window {
        padding: 15px;
    }
    
    .chat-input-area {
        padding: 12px;
        flex-wrap: wrap;
    }
    
    #messageInput {
        min-height: 40px;
        flex: 1 1 100%;
    }
    
    .btn-send {
        padding: 10px 20px;
        font-size: 14px;
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    body {
        height: 100dvh; /* Mobile viewport height */
    }
    
    .form-container {
        max-width: 100%;
        border-radius: 0;
        padding: 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .chat-section {
        border-radius: 0;
    }
    
    .message-content {
        max-width: 85%;
        font-size: 13px;
    }
    
    .chat-header {
        padding: 12px;
    }
    
    .header-content h2 {
        font-size: 16px;
    }
    
    .header-content p {
        font-size: 11px;
    }
    
    .btn-close {
        font-size: 20px;
        padding: 4px 8px;
    }
    
    .chat-input-area {
        padding: 10px;
    }
}
