/* ############################# */
/* Main page styles */
/* ############################# */

body {
    background-color: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    color: #e0e0e0; 
    text-align: center;
    margin-bottom: 50px;
    font-weight: 500; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.resume {
    background: #1e1e1e;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-bottom: 30px;
    margin-top: 30px;
}

.section {
    margin-bottom: 25px;
}

.chat-button {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    background: #2979ff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background 0.2s;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.btn:hover {
    background: #1c54b2;
    transform: translateY(-3px);
    transition: transform 0.3s ease-in-out;
}

.btn:not(:hover) {
    transform: translateY(0);
    transition: transform 0.2s ease-in-out;
}

.pdf-container {
    position: relative;
}

.download-icon {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    color: #e0e0e0;
    background: rgba(50, 50, 50, 0.8);
    padding: 10px;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.download-icon:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* ############################# */
/* Chatbot styles */
/* ############################# */

.chat-container {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
    background: #121212;
    position: relative;
    background: linear-gradient(
        to right,
        #121212,
        #1a1a1a 10%,
        #1a1a1a 90%,
        #121212
    );
}

.chat-header {
    padding: 25px 20px;
    height: 60px;
    border-bottom: 1px solid #333;
    background: #1e1e1e;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 80px;
}

.chat-header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    font-size: 1.5em;
    text-align: center;
    width: auto;
    color: #e0e0e0; 
    font-weight: 500; 
}

.back-button {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1em;
    padding: 8px 15px;
    background: #444; 
    border: 1px solid #555;  
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.4s ease;
    opacity: 0.85;  
    text-decoration: none;
}

.back-button:hover {
    background: #555;  
    color: #fff;
    border-color: #666;
    opacity: 1;
    transform: none;
}

.clear-chat {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 15px;
    background: #444; 
    color: #e0e0e0;  
    border: 1px solid #555;  
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.4s ease;
    opacity: 0.85;  
}

.clear-chat:hover {
    background: #555;  
    color: #ff8585;  
    border-color: #ff8585;
    opacity: 1;
}

/* ###########################
####   Chatbot messages     ##
############################# */

.messages-container {
    flex-grow: 1;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    margin: 0;
    padding: 160px 15% 190px 10%;
    background: linear-gradient(to bottom, #121212 0%, transparent 15%);
}

.messages-container::before {
    content: '';
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, #121212, transparent);
    pointer-events: none;
    z-index: 1000;
}

.chat-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px;
    background: linear-gradient(to top, #121212 70%, transparent 100%);
    z-index: 1000;
}

.message {
    margin-bottom: 35px;
    display: flex;
    opacity: 0;
    transform: translateY(10px);
    animation: messageAppear 0.3s ease forwards;
    position: relative;
}

.message.user {
    justify-content: flex-end;
    padding-left: 35%;
}

.message.bot {
    justify-content: flex-start;
    padding-right: 2%;
}

@keyframes messageAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    background: #1e1e1e;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    position: relative;
}

.message.user .message-content:after {
    content: '';
    position: absolute;
    bottom: 10px;
    right: -10px;
    width: 20px;
    height: 16px;
    background: #2979ff;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.message.bot .message-content:after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: -10px;
    width: 20px;
    height: 16px;
    background: #f0f0f0; 
    border-bottom-right-radius: 16px;
    border-bottom-left-radius: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.message.user .message-content {
    background: #2979ff;
    color: white;
    font-size: 1em;
    max-width: 800px;
    margin-right: 8%;
    padding: 14px 20px;
}

.message.bot .message-content {
    background: #f0f0f0; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    padding: 16px 24px;
    color: #222222; 
    max-width: 800px;
    margin-left: 8px;
    font-size: 1em;
    border-radius: 18px;
    line-height: 1.6;
}

.message.bot br {
    display: block;
    margin: 8px 0;
}

.message.bot .message-content strong {
    font-weight: 600;
    color: #000000; 
}

.message.bot .message-content br {
    display: block;
    margin: 10px 0;
    content: "";
}

.chat-form {
    padding: 20px;
    background: transparent;
    position: fixed;
    bottom: 40px;         
    left: 0;
    right: 0;
    z-index: 1000;
    padding-top: 20px;    
    background: transparent; 
}

.chat-form:focus-within {
    transform: none;
}

.input-container {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    max-width: 800px;
    margin: 0 auto;
    background: #1e1e1e;
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    position: relative;
    backdrop-filter: blur(10px);
    transform: translateY(0);
    transition: all 0.3s ease;
}

.input-container:focus-within {
    box-shadow: 0 6px 24px rgba(0,0,0,0.3);
    transform: translateY(-2px);
    border: 1px solid rgba(255,255,255,0.1);
}

.input-container input {
    flex-grow: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 5px;
    font-size: 1em;
    color: #e0e0e0;
}

.input-container input::placeholder {
    color: #888;
}

.input-container input:focus {
    outline: none;
}

.input-container button {
    padding: 12px 20px;
    background: #2979ff;
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
}

.input-container button:hover {
    background: #1c54b2;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.input-container button:active {
    transform: translateY(0);
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #222222; 
    font-size: 1em;
    font-family: inherit;
    background: transparent;
    line-height: 1.6;
}

.message-content .typing-indicator {
    margin: 0;
    padding: 0;
}

.typing-dots {
    display: inline-flex;
    align-items: baseline;
    gap: 2px; 
    margin-left: 2px; 
    position: relative;
    top: 4px; 
}

.typing-dots span {
    display: inline-block;
    width: 2px;  
    height: 2px; 
    border-radius: 50%;
    background: #555; 
    margin: 0;
    opacity: 0;
    animation: typingDot 2s infinite;
    position: relative;
    top: 2px; 
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) { 
    animation-delay: 0.3s;
}

.typing-dots span:nth-child(3) { 
    animation-delay: 0.6s;
}

@keyframes typingDot {
    0% { opacity: 0; }
    20% { opacity: 1; }
    60% { opacity: 1; }
    80%, 100% { opacity: 0; }
}

#typing-indicator {
    opacity: 0;
    transform: translateY(10px);
    animation: messageAppear 0.3s ease forwards;
    animation-delay: 0.2s; 
}

#typing-indicator .message-content {
    background: #f0f0f0; 
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
    padding: 16px 24px;
    color: #222222; 
    border-radius: 16px;
}

/* error message */
.error-message {
    color: #ff6b6b;
    font-size: 0.9em;
    margin-top: 10px;
    display: none;
}

/* ############################# */
/* Responsive styles */
/* ############################# */

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .resume {
        padding: 20px;
    }

    .chat-header {
        padding: 15px 10px;
    }

    .chat-header h1 {
        font-size: 1.2em;
    }

    .back-button {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .clear-chat {
        padding: 5px 10px;
        font-size: 0.8em;
    }

    .messages-container {
        padding: 120px 10% 140px 5%;
    }

    .message-content {
        padding: 12px 16px; 
    }

    .message.user .message-content:after,
    .message.bot .message-content:after {
        bottom: 8px; 
        width: 16px;
        height: 12px;
    }

    .message.user .message-content {
        margin-right: 6%;
    }

    .message.bot .message-content {
        margin-left: 6px; 
    }

    .input-container {
        padding: 10px 14px;
    }

    .input-container input {
        padding: 10px 14px;
    }

    .input-container button {
        padding: 10px 16px;
    }

    .typing-indicator {
        font-size: 0.9em;
    }

    .typing-dots {
        top: 2px;
    }

    .typing-dots span {
        width: 1px;
        height: 1px;
        top: 1px;
    }
}