/*Licenses:
Mac OS Dock:
Copyright (c) 2024 by Liam (https://codepen.io/Lierrmm/pen/PKEEGa)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -->

/* reset */

html, body {
    margin: 0;
    padding: 0;
    height: 100%; /* Make sure the body is full height */
}

/* main */
body {
    display: flex; 
    justify-content: center; 
    align-items: center;
    font: normal 12px/1.3 Arial, sans-serif;
    color: #333;
    margin-top: 0px;
    margin-left: 0px;
    background: url('http://media.idownloadblog.com/wp-content/uploads/2016/06/macOS-Sierra-Wallpaper-Macbook-Wallpaper.jpg');
    background-size:     cover;                      /* <------ */
    background-repeat:   no-repeat;
    background-position: center center;          
    align-items: center;

  }

  
#dock-container {
            position: fixed;
            bottom: 0;
            text-align: center;
            right: 20%;
            left: 20%;
            width: 60%;
            background: rgba(255,255,255,0.2);
            border-radius: 10px 10px 0 0;
        }
        #dock-container li {
            list-style-type: none;
            display: inline-block;
            position: relative;
        }
   #dock-container li img {
          width: 64px;
          height: 64px;
          -webkit-box-reflect: below 2px,
          -webkit-gradient(linear, left top, left bottom, from(transparent),
                    color-stop(0.7, transparent), to(rgba(255,255,255,.5)));
          -webkit-transition: all 0.3s;
          -webkit-transform-origin: 50% 100%;
        }
#dock-container li:hover img { 
          -webkit-transform: scale(2);
          margin: 0 2em;
        }
        #dock-container li:hover + li img,
        #dock-container li.prev img {
          -webkit-transform: scale(1.5);
          margin: 0 1.5em;
        }
  #dock-container li span {
            display: none;
            position: absolute;
            bottom: 140px;
            left: 0;
            width: 100%;
            background-color: rgba(0,0,0,0.75);
            padding: 4px 0;
            border-radius: 12px;
        }
        #dock-container li:hover span {
            display: block;
            color: #fff;
        }
        

/********************************************************** chat window ********************************************/
.mac-window {
    position: absolute;
    margin: 0;
    width: 400px;
    height: 700px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-80px); /* move it up by 30px */


}

/* Mac-style titlebar */
.mac-titlebar {
    height: 28px;
    background: #f2f2f2;
    border-bottom: 1px solid #ccc;
    display: flex;
    align-items: center;
    position: relative;
}

.traffic-lights {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 1px rgba(0,0,0,0.2);
}

.red {
    background: #ff5f57;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #28c940;
}

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: #555;
    pointer-events: none;
}

/* Modern Chat Window */
.chat-window {
    flex: 1;
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start;
    align-items: flex-start;
    padding: 15px;
    overflow-y: auto;
    background: #f2f2f2;
    scroll-behavior: smooth;
   
}

/* Message Styles */
.message {
    max-width: 75%;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s forwards ease-in-out;
}

.den {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid #ddd;
    border-top-left-radius: 0;
}

.amir {
    align-self: flex-end;
    background: #007bff;
    color: #ffffff;
    border-top-right-radius: 0;
}

/* Typing Indicator */
.typing {
    display: flex;
    align-items: center;
    gap: 4px; 
    max-width: 70%;
    margin: 5px 0;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    opacity: 0;
    transform: translateY(10px);
    animation: fadeInUp 0.3s forwards ease-in-out;
    background-color: #f0f0f0;
}

.typing.left {
    align-self: flex-start;
    background-color: #f0f0f0;
}

.typing.right {
    align-self: flex-end;
    background-color: #0084ff;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: gray;
    border-radius: 50%;
    animation: blink 1.5s infinite;
}

.typing.right .dot {
    background-color: white; 
}

.dot:nth-child(1) {
    animation-delay: 0s;
}
.dot:nth-child(2) {
    animation-delay: 0.2s;
}
.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide scrollbar in WebKit */
.chat-window::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

.chat-window::after {
    content: "";
    display: block;
    height: 20px;
}


/* Mobile Responsiveness */
@media only screen and (max-width: 600px) {
    body {
        background-size: cover;
        background-position: center;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        touch-action: manipulation;
    }

    #dock-container {
        right: 0;
        left: 0;
        width: 100%;
        padding: 5px 0;
    }

    #dock-container li img {
        width: 48px;
        height: 48px;
    }

    #dock-container li:hover img { 
        -webkit-transform: scale(1.5);
        margin: 0 1em;
    }

    .mac-window {
        width: 95%;
        max-width: 500px;
        height: 80vh;
        margin: 0 auto;
        position: relative;
        transform: translateY(-40px);
    }

    .chat-window {
        padding: 10px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    .message {
        max-width: 85%;

    }

    .typing {x
        max-width: 80%;
    }
}

/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) and (max-width: 768px) {
    #dock-container {
        right: 10%;
        left: 10%;
        width: 80%;
    }

    .mac-window {
        width: 80%;
        max-width: 550px;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    #dock-container li:hover img { 
        -webkit-transform: scale(1.2);
        margin: 0 0.5em;
    }

    .message {
        padding: 12px 16px;
    }
}