/* Connectly - Mini WhatsApp Theme */
body {
    margin: 0;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: 
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23be9b7b' fill-opacity='0.08'%3E%3Cpath d='M20 15h12a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3h-6l-4 4v-4h-2a3 3 0 0 1-3-3v-6a3 3 0 0 1 3-3z'/%3E%3Cpath d='M85 20l-15 8l5 2l2 5z'/%3E%3Cpath d='M15 75c-2-2-5-2-7 0c-2 2-2 5 0 7l7 7l7-7c2-2 2-5 0-7c-2-2-5-2-7 0z'/%3E%3Ccircle cx='95' cy='80' r='6' stroke='%23be9b7b' stroke-opacity='0.08' stroke-width='1.5' fill='none'/%3E%3Cpath d='M92 80a3 3 0 0 0 6 0' fill='none' stroke='%23be9b7b' stroke-opacity='0.08' stroke-width='1'/%3E%3Cpath d='M55 50l3 3l6-6' fill='none' stroke='%23be9b7b' stroke-opacity='0.08' stroke-width='1.5'/%3E%3Cpath d='M50 15l1 3l3 1l-3 1l-1 3l-1-3l-3-1l3-1z'/%3E%3C/g%3E%3C/svg%3E"),
        linear-gradient(135deg, #4b3832 0%, #854442 100%);
    background-attachment: fixed;
    min-height: 100vh;
    box-sizing: border-box;
    color: #fff4e6;
    display: flex;
    flex-direction: column;
}

/* Navbar Styles */
.navbar {
    background: rgba(255, 244, 230, 0.05);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(190, 155, 123, 0.3);
    padding: 8px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    margin-left: -20px;
    margin-right: -20px;
    margin-top: -20px;
    margin-bottom: 30px;
}

.navbar-container {
    max-width: 700px; /* Aligns container alignment with chat box width */
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.navbar-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.navbar-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, #fff4e6 0%, #be9b7b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.navbar-tagline {
    font-size: 0.85rem;
    color: rgba(255, 244, 230, 0.8);
    margin-top: 2px;
}

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

@media (max-width: 768px) {
    .navbar {
        margin-left: -12px;
        margin-right: -12px;
        margin-top: -12px;
        padding: 12px 15px;
    }
}

@media (max-width: 600px) {
    .navbar-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }
    
    .navbar-brand {
        align-items: center;
    }
    
    .navbar-title {
        font-size: 1.75rem;
    }
    
    .navbar-tagline {
        font-size: 0.8rem;
    }
}

/* Main heading */
h3 {
    color: #fff4e6;
    font-size: 1.75rem;
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(60, 47, 47, 0.3);
    font-weight: 600;
}

/* New Chat button */
form[action="/chats/new"] {
    margin-bottom: 30px;
}

form[action="/chats/new"] button {
    background: linear-gradient(135deg, #be9b7b 0%, #854442 100%);
    color: #fff4e6;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(60, 47, 47, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

form[action="/chats/new"] button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(60, 47, 47, 0.4);
}

/* Chat container */
/* Main content container */
.main-content {
    flex: 1;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.chat {
    background: rgba(255, 244, 230, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
    box-shadow:
        0 4px 20px rgba(60, 47, 47, 0.2),
        0 2px 8px rgba(60, 47, 47, 0.1);
    border: 1px solid rgba(190, 155, 123, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #4b3832;
    animation: fadeInUp 0.4s ease-out both;
}

.chat:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 25px rgba(60, 47, 47, 0.25),
        0 4px 12px rgba(60, 47, 47, 0.15);
}

/* Chat metadata (From/To) */
.chat>p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #854442;
    font-weight: 500;
}

.chat>p i {
    color: #4b3832;
    font-weight: 600;
}

/* Message bubble */
.msg {
    background: linear-gradient(135deg, #4b3832 0%, #854442 100%);
    color: #fff4e6;
    padding: 25px 20px;
    border-radius: 18px;
    margin: 15px 0;
    min-height: 110px;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(60, 47, 47, 0.3);
    position: relative;
}

.msg p {
    margin: 0 0 15px 0;
    font-size: 1rem;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Action buttons */
.msg button {
    background: rgba(255, 244, 230, 0.2);
    color: #fff4e6;
    border: 1px solid rgba(255, 244, 230, 0.3);
    padding: 6px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    text-transform: capitalize;
}

.msg button:hover {
    background: rgba(255, 244, 230, 0.3);
    border-color: rgba(255, 244, 230, 0.5);
    transform: scale(1.05);
}

/* Delete button - special styling */
form[action*="DELETE"] button {
    background: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
    color: #ffccd5;
}

form[action*="DELETE"] button:hover {
    background: rgba(220, 53, 69, 0.3);
    border-color: rgba(220, 53, 69, 0.5);
}

/* Timestamp styling */
.chat p:last-child,
.chat p:nth-last-child(2) {
    font-size: 0.8rem;
    color: #be9b7b;
    margin: 5px 0;
    font-weight: 400;
}

/* Horizontal rule */
hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(190, 155, 123, 0.3), transparent);
    margin: 15px 0;
}

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

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    h3 {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }

    .chat {
        padding: 16px;
    }

    .msg {
        padding: 12px 16px;
    }

    form[action="/chats/new"] button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* About Connectly Button & Modal Styling */
.btn-about {
    background: linear-gradient(135deg, #be9b7b 0%, #854442 100%);
    color: #fff4e6;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(60, 47, 47, 0.3);
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-about:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(60, 47, 47, 0.4);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(60, 47, 47, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-box {
    background: rgba(255, 244, 230, 0.98);
    color: #4b3832;
    padding: 30px;
    border-radius: 20px;
    max-width: 650px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(60, 47, 47, 0.5);
    border: 2px solid #be9b7b;
    position: relative;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2.5rem;
    font-weight: 300;
    color: #854442;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #4b3832;
}

.modal-body h2 {
    margin-top: 0;
    color: #854442;
    font-size: 1.8rem;
    border-bottom: 2px solid #be9b7b;
    padding-bottom: 10px;
}

.modal-body h3 {
    color: #854442;
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
    text-shadow: none;
}

.modal-body p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal-body ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.modal-body li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.modal-body li strong {
    color: #854442;
}

.modal-body code {
    background-color: rgba(133, 68, 66, 0.1);
    color: #854442;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    
    .modal-box {
        padding: 20px;
        width: 95%;
    }
}

/* Chat card reveal animations and floating doodles keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat:nth-of-type(1) { animation-delay: 0.05s; }
.chat:nth-of-type(2) { animation-delay: 0.1s; }
.chat:nth-of-type(3) { animation-delay: 0.15s; }
.chat:nth-of-type(4) { animation-delay: 0.2s; }
.chat:nth-of-type(5) { animation-delay: 0.25s; }

/* Floating Doodles */
.floating-doodle {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    opacity: 0.12;
    color: #be9b7b;
}

.doodle-1 {
    top: 15%;
    left: 5%;
    animation: float-slow 15s ease-in-out infinite;
    width: 60px;
    height: 60px;
}

.doodle-2 {
    top: 45%;
    right: 8%;
    animation: float-reverse 20s ease-in-out infinite;
    width: 80px;
    height: 80px;
}

.doodle-3 {
    bottom: 15%;
    left: 8%;
    animation: float-slow 18s ease-in-out infinite;
    width: 70px;
    height: 70px;
}

.doodle-4 {
    top: 75%;
    left: 45%;
    animation: float-reverse 25s ease-in-out infinite;
    width: 50px;
    height: 50px;
}

.doodle-5 {
    top: 8%;
    right: 25%;
    animation: float-slow 22s ease-in-out infinite;
    width: 65px;
    height: 65px;
}

@keyframes float-slow {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(15deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes float-reverse {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(20px) rotate(-15deg);
    }
    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

/* Creative Footer Styles */
.main-footer {
    background: rgba(255, 244, 230, 0.05);
    backdrop-filter: blur(10px);
    border-top: 2px solid rgba(190, 155, 123, 0.4);
    border-radius: 24px 24px 0 0;
    padding: 30px 20px;
    margin-top: 60px;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -20px;
    box-sizing: border-box;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-info p {
    margin: 0;
    font-size: 0.9rem;
}

.copyright {
    color: rgba(255, 244, 230, 0.8);
    font-weight: 400;
}

.developer {
    color: #fff4e6;
    font-weight: 500;
}

.dev-name {
    color: #be9b7b;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed rgba(190, 155, 123, 0.5);
    padding-bottom: 2px;
}

.footer-socials {
    display: flex;
    gap: 15px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 244, 230, 0.1);
    color: #fff4e6;
    border: 1px solid rgba(190, 155, 123, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-link svg {
    width: 18px;
    height: 18px;
}

.social-link:hover {
    background: linear-gradient(135deg, #be9b7b 0%, #854442 100%);
    color: #fff4e6;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(60, 47, 47, 0.4);
    border-color: transparent;
}

@media (max-width: 768px) {
    .main-footer {
        margin-left: -12px;
        margin-right: -12px;
        margin-bottom: -12px;
        padding: 25px 15px;
    }
}

@media (max-width: 600px) {
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-info {
        align-items: center;
    }
}

/* Floating CRUD Text */
.floating-text {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-weight: 900;
    font-size: 5rem;
    color: #be9b7b;
    opacity: 0.06;
}

.crud-word-1 {
    top: 25%;
    left: 8%;
    animation: float-slow 18s ease-in-out infinite;
}

.crud-word-2 {
    top: 55%;
    right: 10%;
    animation: float-reverse 22s ease-in-out infinite;
}

.crud-word-3 {
    bottom: 20%;
    left: 15%;
    animation: float-slow 20s ease-in-out infinite;
}