* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: white;
    height: 100vh;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Calculator Styles */
.calculator {
    max-width: 400px;
    margin: 20px auto;
    padding: 20px;
    background: #2d2d2d;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.display {
    margin-bottom: 20px;
}

#display {
    width: 100%;
    height: 80px;
    font-size: 2.5em;
    text-align: right;
    padding: 0 20px;
    background: #1a1a1a;
    border: none;
    border-radius: 10px;
    color: white;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.btn {
    height: 70px;
    border: none;
    border-radius: 15px;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:active {
    transform: scale(0.95);
}

.number {
    background: #404040;
    color: white;
}

.number:active {
    background: #505050;
}

.operator {
    background: #ff9500;
    color: white;
}

.operator:active {
    background: #ffaa33;
}

.clear {
    background: #a6a6a6;
    color: black;
}

.clear:active {
    background: #bfbfbf;
}

.equals {
    background: #ff9500;
    color: white;
}

.equals:active {
    background: #ffaa33;
}

.zero {
    grid-column: span 2;
}

/* Chat Styles */
.chat {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

.chat-header {
    background: #2d2d2d;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #404040;
}

.chat-header h2 {
    color: #ff9500;
}

.lock-btn, .export-btn, .import-btn {
    background: #404040;
    border: none;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.2em;
    margin-left: 10px;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 15px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.own {
    background: #0066cc;
    margin-left: auto;
}

.message.other {
    background: #404040;
}

.message-sender {
    font-size: 0.8em;
    opacity: 0.7;
    margin-bottom: 5px;
}

.message-input {
    padding: 20px;
    background: #2d2d2d;
    display: flex;
    gap: 10px;
}

#messageInput {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 10px;
    background: #404040;
    color: white;
    font-size: 1em;
}

.message-input button {
    padding: 15px 25px;
    background: #0066cc;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

/* Admin Panel */
.admin-panel {
    background: #2d2d2d;
    padding: 20px;
    border-top: 1px solid #404040;
}

.config-section {
    margin-bottom: 15px;
}

.config-section label {
    display: block;
    margin-bottom: 5px;
    color: #a6a6a6;
}

.config-section button {
    background: #404040;
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 10px;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #2d2d2d;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-bottom: 20px;
    color: #ff9500;
}

.modal-content textarea {
    width: 100%;
    height: 200px;
    background: #404040;
    border: none;
    border-radius: 10px;
    padding: 15px;
    color: white;
    font-family: monospace;
    resize: vertical;
}

.modal-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.modal-actions button:first-child {
    background: #0066cc;
    color: white;
}

.modal-actions button:last-child {
    background: #404040;
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    .calculator {
        margin: 10px;
        padding: 15px;
    }
    
    #display {
        height: 60px;
        font-size: 2em;
    }
    
    .btn {
        height: 60px;
        font-size: 1.2em;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .message {
        max-width: 90%;
    }
}

/* Add these styles to the existing CSS file */

.typing-indicator {
    opacity: 0.7;
}

.typing-dots {
    display: flex;
    gap: 4px;
    padding: 5px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #fff;
    animation: typing-bounce 1.4s ease-in-out infinite both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Message transitions */
.message {
    animation: message-appear 0.3s ease-out;
}

@keyframes message-appear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}