/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.logo {
    height: 60px;
}

.image-player {
    cursor: pointer;
    transition: transform 0.3s ease;
}
.image-player:hover {
    transform: scale(1.05);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(to bottom, #f0f2f5, #ffffff);
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.description {
    text-align: center;
    margin-bottom: 30px;
    color: #7f8c8d;
}

.nav-link {
    background-color: #333;
    color: white !important;
    margin: 0 5px;
    padding: 8px 16px !important;
    border-radius: 4px;
}

.nav-link:hover {
    background-color: #444;
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-swatches {
    display: flex;
    gap: 5px;
}

.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid #ddd;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
}

.color-swatch.active {
    border: 2px solid #333;
}

.color-swatch[data-color="#FFFFFF"] {
    box-shadow: inset 0 0 0 1px #ddd;
}

#colorPicker {
    width: 32px;
    height: 32px;
    border: none;
    cursor: pointer;
}

.brush-size {
    display: flex;
    align-items: center;
    gap: 10px;
}

#brushSize {
    width: 100px;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-success {
    background-color: #2ecc71;
    color: white;
}

.btn-success:hover {
    background-color: #27ae60;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

/* Canvas */
.canvas-container {
    position: relative;
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#drawingCanvas {
    width: 100%;
    height: 600px;
    background-color: white;
    touch-action: none;
    cursor: crosshair;
}

/* User Counter */
.user-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 10;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-left-color: #2c3e50;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    #drawingCanvas {
        height: 400px;
    }
}

.top-bar {
    background-color: #1a1f3c;
    color: white;
    padding: 4px 0;
    font-size: 14px;
}

/* Chat Styles */
.chat-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.username-container {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.username-input-group {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

#usernameInput {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.message {
    padding: 10px;
    border-radius: 8px;
    max-width: 85%;
    word-break: break-word;
}

.message-self {
    align-self: flex-end;
    background-color: #d1ecf1;
    border-bottom-right-radius: 0;
}

.message-other {
    align-self: flex-start;
    background-color: #f8f9fa;
    border-bottom-left-radius: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.message-username {
    font-weight: bold;
    color: #2c3e50;
}

.message-time {
    color: #7f8c8d;
}

.message-content {
    font-size: 0.95rem;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ddd;
    gap: 10px;
}

#chatInput {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* System Message */
.system-message {
    text-align: center;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin: 5px 0;
    align-self: center;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .chat-section {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    #drawingCanvas {
        height: 400px;
    }
}
/* Main Content Layout */
.main-content {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.drawing-section {
    flex: 3;
}

.chat-section {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Chat Styles */
.chat-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.username-container {
    padding: 15px;
    border-bottom: 1px solid #ddd;
}

.username-input-group {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

#usernameInput {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
     
.message {
    padding: 10px;
    border-radius: 8px;
    max-width: 85%;
    word-break: break-word;
}

.message-self {
    align-self: flex-end;
    background-color: #d1ecf1;
    border-bottom-right-radius: 0;
}

.message-other {
    align-self: flex-start;
    background-color: #f8f9fa;
    border-bottom-left-radius: 0;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.message-username {
    font-weight: bold;
    color: #2c3e50;
}

.message-time {
    color: #7f8c8d;
}

.message-content {
    font-size: 0.95rem;
}

#chatInput {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* System Message */
.system-message {
    text-align: center;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #7f8c8d;
    margin: 5px 0;
    align-self: center;
}

/* Responsive Design */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .chat-section {
        height: 400px;
    }
}

/* Vertical Layout */
.main-content-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.drawing-section {
    width: 100%;
}

/* Canvas - Larger drawing area */
#drawingCanvas {
    width: 100%;
    height: 700px; /* Increased height */
    background-color: white;
    touch-action: none;
    cursor: crosshair;
}

/* Chat Section - Below drawing */
.chat-section-bottom {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 500px; /* Adjusted height */
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chat-section-chat {
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 500px; /* Adjusted height */
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.chat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chat-header {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.username-container {
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input-container {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #ddd;
    gap: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #drawingCanvas {
        height: 500px;
    }
    
    .chat-section-bottom {
        height: 250px;
    }
}