* {
    box-sizing: border-box;
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
}

body {
    background: #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.phone {
    width: 360px;
    height: 700px;
    background: #e5ddd5;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
}

/* STATUS BAR */
.status-bar {
    background: #000;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 25px;
}

/* HEADER */
.chat-header {
    background: #075e54;
    color: #fff;
    padding: 10px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.header-left i {
    font-size: 20px;
    cursor: pointer;
    margin-right: 10px;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.conversation-count {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 25px;
    text-align: center;
}

.contact-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.contact-info img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
}

.contact-text {
    display: flex;
    flex-direction: column;
}

.contact-name {
    font-weight: 600;
    font-size: 16px;
}

.contact-status {
    font-size: 12px;
    opacity: 0.9;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right i {
    font-size: 20px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.header-right i:hover {
    opacity: 0.8;
}

/* CHAT */
.chat-body {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMjAgMGMxMSAwIDIwIDkgMjAgMjBzLTkgMjAtMjAgMjBTMCAzMSAwIDIwIDkgMCAyMCAwem0wIDJjLTkuOSAwLTE4IDguMS0xOCAxOHM4LjEgMTggMTggMTggMTgtOC4xIDE4LTE4UzI5LjkgMiAyMCAyeiIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMDQiLz48L3N2Zz4=');
    background-size: 40px 40px;
}

.chat-date {
    text-align: center;
    font-size: 12px;
    margin: 10px 0;
    color: #555;
    background: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 15px;
    display: inline-block;
    margin-left: 50%;
    transform: translateX(-50%);
}

/* MESSAGES */
.message {
    max-width: 75%;
    padding: 6px 12px 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    position: relative;
    word-wrap: break-word;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.1s;
}

.message:hover {
    transform: scale(1.01);
}

.message.sent {
    float: right;
    clear: both;
}

.message.received {
    float: left;
    clear: both;
}

.message-content {
    margin-bottom: 3px;
    min-height: auto;
    line-height: 1.4;
}

.message img {
    max-width: 100%;
    border-radius: 6px;
    margin-bottom: 5px;
    display: block;
}

.sent {
    background: #dcf8c6;
    border-top-right-radius: 0;
}

.received {
    background: #fff;
    border-top-left-radius: 0;
}

.message-time {
    font-size: 11px;
    text-align: right;
    color: #555;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 3px;
    float: right;
    clear: both;
}

/* Mensagens de áudio */
.audio-message {
    padding: 8px 12px;
    width: 180px;
}

.audio-container {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
}

.audio-play {
    color: #075e54;
    font-size: 16px;
    cursor: pointer;
    background: rgba(7,94,84,0.1);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.audio-play:hover {
    background: rgba(7,94,84,0.2);
}

.audio-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    height: 25px;
}

.audio-bar {
    width: 3px;
    background: #075e54;
    border-radius: 2px;
    animation: wave 1.5s ease-in-out infinite;
}

.audio-bar:nth-child(1) { height: 8px; animation-delay: 0.1s; }
.audio-bar:nth-child(2) { height: 15px; animation-delay: 0.2s; }
.audio-bar:nth-child(3) { height: 20px; animation-delay: 0.3s; }
.audio-bar:nth-child(4) { height: 15px; animation-delay: 0.4s; }
.audio-bar:nth-child(5) { height: 8px; animation-delay: 0.5s; }

.audio-duration {
    font-size: 11px;
    color: #555;
    min-width: 35px;
    text-align: right;
}

@keyframes wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

/* FOOTER */
.chat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f0f0f0;
    border-top: 1px solid #ddd;
    position: relative;
}

.message-box {
    flex: 1;
    background: #fff;
    border-radius: 20px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
}

.message-box i {
    color: #666;
    cursor: pointer;
    font-size: 18px;
    transition: color 0.2s;
}

.message-box i:hover {
    color: #075e54;
}

/* Botão do WhatsApp */
.whatsapp-send {
    background: #075e54 !important;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.whatsapp-send:hover {
    background: #0c7d6c !important;
}

.whatsapp-send i {
    transform: rotate(45deg);
}

.whatsapp-send-option {
    background: #075e54 !important;
    color: white !important;
}

.whatsapp-send-option:hover {
    background: #0c7d6c !important;
}

.whatsapp-send-option i {
    transform: rotate(45deg);
}

.send-btn {
    border: none;
    background: #075e54;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.send-btn:hover {
    background: #0c7d6c;
}

.sender-options {
    display: none;
    position: absolute;
    right: 60px;
    background: white;
    border-radius: 20px;
    padding: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    gap: 5px;
}

.sender-btn {
    border: none;
    background: #f0f0f0;
    color: #075e54;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
}

.sender-btn:hover {
    background: #e0e0e0;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-box {
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    width: 85%;
    max-width: 400px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal-box h3 {
    margin-bottom: 15px;
    color: #075e54;
    text-align: center;
}

.modal-box input,
.modal-box textarea,
.modal-box select,
.modal-box button {
    width: 100%;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.modal-box textarea {
    min-height: 80px;
    resize: vertical;
}

.modal-box button {
    background: #075e54;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.modal-box button:hover {
    background: #0c7d6c;
}

.cancel-btn {
    background: #999 !important;
    margin-top: 5px;
}

.cancel-btn:hover {
    background: #777 !important;
}

.delete-btn {
    background: #ff4444 !important;
    margin-top: 10px;
}

.delete-btn:hover {
    background: #cc0000 !important;
}

#editPreview {
    max-width: 100%;
    margin-bottom: 10px;
}

#editPreview img {
    max-width: 100%;
    border-radius: 6px;
}

/* Gravação de áudio */
.audio-recorder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 10px;
    margin-bottom: 15px;
}

.recording-icon {
    color: #ff3b30;
    font-size: 24px;
    animation: pulse 1s infinite;
}

.recording-time {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.recording-wave {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 30px;
}

.wave-bar {
    width: 4px;
    background: #075e54;
    border-radius: 2px;
    animation: wave 1s ease-in-out infinite;
}

.audio-duration-input {
    margin: 10px 0;
}

.audio-duration-input label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #333;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
/* Inputs de tempo personalizados */
.time-input, .duration-input {
    font-family: monospace;
    text-align: center;
    letter-spacing: 2px;
}

.time-input::placeholder, .duration-input::placeholder {
    color: #999;
    letter-spacing: normal;
}

.time-input:focus, .duration-input:focus {
    border-color: #075e54;
    outline: none;
}