/* public/css/style.css */

/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 10px 20px;
    position: relative;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5em;
    font-weight: bold;
    margin-right: 20px;
    color: #ecf0f1;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
}

.nav-links li {
    margin-right: 15px;
}

.nav-links li a {
    color: #ecf0f1;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #bdc3c7;
}

/* Mobile Navigation */
.mobile-nav-links {
    display: none;
    list-style: none;
    flex-direction: column;
    background-color: #34495e;
    position: absolute;
    top: 60px;
    right: 20px;
    width: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.mobile-nav-links.active {
    display: flex;
}

.mobile-nav-links li {
    margin: 10px 0;
    text-align: center;
}

.mobile-nav-links li a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.1em;
    display: block;
    padding: 10px 0;
}

.mobile-nav-links li a:hover {
    background-color: #3d566e;
}

/* Navbar Toggle Button */
.navbar-toggle {
    display: none;
    font-size: 1.8em;
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
}

/* Language Selector */
.language-selector {
    margin-left: 15px;
}

.language-selector form select {
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    background-color: #34495e;
    color: #ecf0f1;
    transition: background-color 0.3s ease;
}

.language-selector form select:hover {
    background-color: #3d566e;
}

/* Main Content Styles */
main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Footer Styles */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    text-align: center;
    padding: 15px 0;
    position: relative;
}

/* Section Styles */
.welcome-section,
.login-section,
.register-section,
.manage-users-section,
.dashboard-section,
.view-tickets-section,
.create-ticket-section,
.chat-section,
.shareable-ticket-section,
.profile-section,
.password-reset-section,
.ticket-details-section,
.manage-tickets-section {
    background-color: #fff;
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Headings */
h1, h2, h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: bold;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3498db;
    outline: none;
}

/* Button Styles */
.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #3498db;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

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

.btn-primary {
    background-color: #3498db;
}

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

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-login {
    background-color: #27ae60;
}

.btn-login:hover {
    background-color: #1e8449;
}

.btn-register {
    background-color: #8e44ad;
}

.btn-register:hover {
    background-color: #732d91;
}

.btn-send {
    background-color: #3498db;
}

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

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #2ecc71;
    color: #fff;
    padding: 15px 20px;
    border-radius: 6px;
    display: none;
    z-index: 1001;
    animation: fadeIn 0.5s, fadeOut 0.5s 4.5s;
}

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

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

/* Error and Success Messages */
.error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px 20px;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px 20px;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    margin-bottom: 20px;
    animation: fadeIn 0.5s;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Inline Forms */
.inline-form {
    display: inline-block;
}

.inline-form .btn {
    padding: 8px 15px;
    font-size: 0.9em;
}

/* Admin Labels */
.admin-label {
    background-color: #ffc107;
    color: #212529;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Chat Section */
.chat-section {
    display: flex;
    flex-direction: column;
    height: 80vh;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* Chat Heading */
.chat-section h2 {
    text-align: center;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* Ticket Information */
.ticket-info {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.ticket-info p {
    margin: 5px 0;
    font-size: 1em;
}

/* Messages Container */
.messages {
    flex: 1;
    padding: 15px;
    border: 1px solid #ccc;
    background-color: #fafafa;
    overflow-y: auto;
    margin-bottom: 15px;
    border-radius: 8px;
    position: relative;
}

/* Individual Message */
.message {
    margin-bottom: 15px;
    max-width: 70%;
    padding: 12px 15px;
    border-radius: 10px;
    position: relative;
    word-wrap: break-word;
    font-size: 0.95em;
}

/* Sent Messages */
.message.sent {
    background-color: #dcf8c6;
    align-self: flex-end;
    text-align: right;
    margin-left: auto;
}

/* Received Messages */
.message.received {
    background-color: #ffffff;
    align-self: flex-start;
    text-align: left;
    margin-right: auto;
    border: 1px solid #e0e0e0;
}

/* Sender Name */
.message .sender {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

/* Message Content */
.message .content {
    display: block;
    margin-bottom: 5px;
}

/* File and Media Content */
.message-image, .message-video, .message-audio {
    max-width: 100%;
    margin-top: 5px;
    border-radius: 6px;
}

.message-file {
    display: inline-block;
    margin-top: 5px;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.message-file:hover {
    text-decoration: underline;
}

/* Timestamp */
.timestamp {
    display: block;
    font-size: 0.75em;
    color: #888;
    margin-top: 5px;
}

/* Typing Indicator */
.typing-indicator {
    min-height: 20px;
    margin-bottom: 10px;
    font-style: italic;
    color: #555;
}

/* Form Group */
.form-group {
    display: flex;
    align-items: center;
    position: relative;
}

/* Message Input */
#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1em;
    resize: none;
    transition: border-color 0.3s ease;
}

#message-input:focus {
    border-color: #3498db;
    outline: none;
}

/* Emoji Picker Button */
#emoji-button {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    color: #555;
    transition: color 0.3s ease;
}

#emoji-button:hover {
    color: #3498db;
}

/* File Input Group */
.file-input-group {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
}

#file-input {
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 0.95em;
    transition: border-color 0.3s ease;
}

#file-input:focus {
    border-color: #3498db;
    outline: none;
}

/* Send Button */
.btn-send {
    padding: 12px 25px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-send:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

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

/* Notification Sound (Hidden Audio Element) */
#notification-sound {
    display: none;
}

/* Role Labels */
.role-label {
    font-size: 0.8em;
    margin-left: 5px;
    padding: 2px 4px;
    border-radius: 4px;
    color: #fff;
}

.role-label.admin {
    background-color: #e74c3c; /* Red */
}

.role-label.support {
    background-color: #3498db; /* Blue */
}

.role-label.customer {
    background-color: #2ecc71; /* Green */
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Navbar Toggle Button */
    .navbar-toggle {
        display: block;
    }

    /* Hide Desktop Navigation Links */
    .nav-links {
        display: none;
    }

    /* Mobile Navigation Menu */
    .mobile-nav-links {
        display: none;
    }

    .mobile-nav-links.active {
        display: flex;
    }

    /* Adjust Chat Section Height */
    .chat-section {
        height: 75vh;
        padding: 15px;
    }

    /* Adjust Messages Container */
    .messages {
        max-height: 350px;
        padding: 10px;
    }

    /* Adjust Message Width */
    .message {
        max-width: 85%;
    }

    /* Adjust Emoji Button Size */
    #emoji-button {
        font-size: 1.3em;
    }

    /* Adjust Send Button Size */
    .btn-send {
        padding: 10px 20px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    /* Further Adjustments for Very Small Screens */
    .chat-section {
        height: 70vh;
        padding: 10px;
    }

    .messages {
        max-height: 300px;
        padding: 8px;
    }

    .message {
        max-width: 95%;
    }

    #message-input {
        padding: 10px 12px;
        font-size: 0.9em;
    }

    #emoji-button {
        font-size: 1.2em;
    }

    .btn-send {
        padding: 8px 18px;
        font-size: 0.9em;
    }
}

/* Mobile Navigation */
.mobile-nav-links {
    display: none;
    list-style: none;
    flex-direction: column;
    background-color: #34495e;
    position: absolute;
    top: 60px;
    right: 20px;
    width: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.mobile-nav-links.active {
    display: flex;
}

.mobile-nav-links li {
    margin: 10px 0;
    text-align: center;
}

.mobile-nav-links li a {
    color: #ecf0f1;
    text-decoration: none;
    font-size: 1.1em;
    display: block;
    padding: 10px 0;
}

.mobile-nav-links li a:hover {
    background-color: #3d566e;
}

/* Navbar Toggle Button */
.navbar-toggle {
    display: none;
    font-size: 1.8em;
    background: none;
    border: none;
    color: #ecf0f1;
    cursor: pointer;
}

/* Adjust Navbar for Mobile */
@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }

    .nav-links {
        display: none;
    }
}

/* Additional Styling for Forms and Buttons */
.auth-buttons,
.user-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.auth-buttons .btn,
.user-actions .btn {
    flex: 1;
    max-width: 200px;
}

.auth-form {
    max-width: 500px;
    margin: 0 auto;
}

.auth-form .btn {
    width: 100%;
}

/* General Button Adjustments */
.btn-primary {
    background-color: #3498db;
}

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

.btn-secondary {
    background-color: #95a5a6;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.btn-login {
    background-color: #27ae60;
}

.btn-login:hover {
    background-color: #1e8449;
}

.btn-register {
    background-color: #8e44ad;
}

.btn-register:hover {
    background-color: #732d91;
}

.btn-send {
    background-color: #3498db;
}

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

/* Language Selector */
.language-selector {
    margin-left: 15px;
}

.language-selector form select {
    padding: 5px 10px;
    border-radius: 4px;
    border: none;
    font-size: 1em;
    cursor: pointer;
    background-color: #34495e;
    color: #ecf0f1;
    transition: background-color 0.3s ease;
}

.language-selector form select:hover {
    background-color: #3d566e;
}

/* Support Users Display */
.support-user {
    display: inline-block;
    background-color: #17a2b8;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* Unassigned Label */
.unassigned {
    color: #dc3545;
    font-weight: bold;
}

/* Search Form */
.search-form {
    display: flex;
    margin-bottom: 20px;
}

.search-form input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ccc;
    border-radius: 6px 0 0 6px;
    font-size: 1em;
}

.search-form .btn-search {
    padding: 12px 20px;
    border: none;
    background-color: #8e44ad;
    color: #fff;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-form .btn-search:hover {
    background-color: #732d91;
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Slide Up Animation */
@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.slide-up {
    animation: slideUp 0.5s ease-in-out;
}

/* Applying Animations */
.modal-content,
.manage-users-section .stat,
.manage-tickets-section .stat,
.message,
.btn {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s forwards;
}

.message.sent,
.message.received {
    animation: slideUp 0.5s forwards;
}

/* Emoji Picker Styling */
.emoji-picker {
    position: absolute;
    bottom: 60px; /* Adjust based on input height */
    right: 10px;
    z-index: 1002;
}

/* public/css/style.css */

/* Existing styles remain unchanged */

/* Additional Styles for Chat Screen */

.chat-section {
    display: flex;
    flex-direction: column;
    height: 80vh;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background-color: #2c3e50;
    color: #ecf0f1;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.chat-header .header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header .header-info p {
    margin: 0;
    font-size: 1em;
}

.chat-header .header-info .language-status {
    background-color: #34495e;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}

/* Messages Container */
.messages {
    flex: 1;
    padding: 15px;
    border: none;
    background-color: #fafafa;
    overflow-y: auto;
    margin-bottom: 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Individual Message */
.message {
    margin-bottom: 15px;
    max-width: 70%;
    padding: 12px 15px;
    border-radius: 10px;
    position: relative;
    word-wrap: break-word;
    font-size: 0.95em;
}

.message.sent {
    background-color: #dcf8c6;
    align-self: flex-end;
    text-align: right;
    margin-left: auto;
}

.message.received {
    background-color: #ffffff;
    align-self: flex-start;
    text-align: left;
    margin-right: auto;
    border: 1px solid #e0e0e0;
}

.message .sender {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2c3e50;
}

.message .content {
    display: block;
    margin-bottom: 5px;
}

.message-image, .message-video, .message-audio {
    max-width: 100%;
    margin-top: 5px;
    border-radius: 6px;
}

.message-file {
    display: inline-block;
    margin-top: 5px;
    color: #3498db;
    text-decoration: none;
    font-weight: bold;
}

.message-file:hover {
    text-decoration: underline;
}

.timestamp {
    display: block;
    font-size: 0.75em;
    color: #888;
    margin-top: 5px;
}

/* Typing Indicator */
.typing-indicator {
    min-height: 20px;
    margin-bottom: 10px;
    font-style: italic;
    color: #555;
}

/* Message Form */
.message-form {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    background-color: #f0f2f5;
    border-top: 1px solid #ccc;
}

.message-form .form-group {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
}

#message-input {
    flex: 1;
    padding: 10px 45px 10px 15px;
    border: 1px solid #ccc;
    border-radius: 20px;
    font-size: 1em;
    resize: none;
    transition: border-color 0.3s ease;
}

#message-input:focus {
    border-color: #3498db;
    outline: none;
}

#emoji-button {
    position: absolute;
    right: 40px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2em;
    color: #555;
    transition: color 0.3s ease;
}

#emoji-button:hover {
    color: #3498db;
}

.file-input-group {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

#file-input {
    display: none;
}

.attach-button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5em;
    color: #555;
    margin-right: 10px;
    transition: color 0.3s ease;
}

.attach-button:hover {
    color: #3498db;
}

.btn-send {
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn-send:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

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

/* Hide "Max 50 MB" text */
.file-input-group p {
    display: none;
}

/* Responsive Design */

@media (max-width: 768px) {
    .chat-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px 15px;
    }

    .chat-header .header-info {
        width: 100%;
        justify-content: space-between;
    }

    .chat-header .header-info p {
        font-size: 0.9em;
    }

    .messages {
        padding: 10px;
    }

    .message {
        max-width: 85%;
    }

    .message-form {
        padding: 8px 15px;
    }

    #message-input {
        padding: 8px 35px 8px 12px;
        font-size: 0.9em;
    }

    #emoji-button {
        right: 35px;
        font-size: 1.1em;
    }

    .attach-button {
        font-size: 1.3em;
    }

    .btn-send {
        padding: 8px 18px;
        font-size: 0.95em;
    }
}

@media (max-width: 480px) {
    .chat-header {
        padding: 8px 10px;
    }

    .chat-header .header-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .chat-header .header-info p {
        font-size: 0.8em;
    }

    .messages {
        padding: 8px;
    }

    .message {
        max-width: 95%;
    }

    .message-form {
        padding: 5px 10px;
    }

    #message-input {
        padding: 6px 30px 6px 10px;
        font-size: 0.85em;
    }

    #emoji-button {
        right: 30px;
        font-size: 1em;
    }

    .attach-button {
        font-size: 1.2em;
    }

    .btn-send {
        padding: 6px 15px;
        font-size: 0.85em;
    }
}

