/* GOROK AI Chat Page Specific Styles */

/* Main Container */
.gorok-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 2rem;
    width: 100%;
    z-index: 10;
    animation: fadeIn 1.5s ease-in-out;
    margin: 80px auto 0;
    position: relative;
    max-width: 1200px;
}

.gorok-header {
    text-align: center;
    margin-bottom: 1rem;
}

.gorok-main {
    display: flex;
    gap: 2rem;
    height: calc(100vh - 250px);
    min-height: 500px;
}

/* Conversations Sidebar */
.conversations-sidebar {
    width: 280px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    border: 2px solid #8A2BE2;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(138, 43, 226, 0.5);
}

.sidebar-header h3 {
    color: #00ffff;
    font-family: 'Audiowide', cursive;
    text-shadow: 0 0 10px #00ffff;
    margin: 0;
}

#new-chat-button {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #8A2BE2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.conversation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    color: #fff;
}

.conversation-item:hover {
    background: rgba(138, 43, 226, 0.2);
    border-color: #00ffff;
}

.conversation-item.active {
    background: rgba(138, 43, 226, 0.3);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.delete-conversation-button {
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 5px;
}

.delete-conversation-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

.delete-conversation-button .icon-img {
    width: 16px;
    height: 16px;
}

/* Chat Section */
.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    border: 2px solid #8A2BE2;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.5);
    overflow: hidden;
}

/* Personality Selector */
.personality-selector {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #8A2BE2;
}

.personality-title {
    color: #00ffff;
    font-size: 0.9rem;
    margin-right: 1rem;
    text-shadow: 0 0 5px #00ffff;
}

.personality-options {
    display: flex;
    gap: 0.5rem;
}

.personality-option {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(138, 43, 226, 0.5);
    border-radius: 20px;
    color: #fff;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.personality-option:hover {
    background: rgba(138, 43, 226, 0.3);
    border-color: #00ffff;
}

.personality-option.active {
    background: rgba(138, 43, 226, 0.5);
    border-color: #00ffff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    gap: 1rem;
}

.chat-output {
    flex: 1;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 15px;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chat-input-container {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #8A2BE2;
    border-radius: 50px;
    padding: 0.5rem 1rem;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.3);
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Audiowide', cursive;
    font-size: 1rem;
    outline: none;
}

.action-button {
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    margin-left: 0.5rem;
}

.action-button:hover {
    transform: scale(1.1);
    animation: neonGlow 1s infinite;
}

.icon-img {
    width: 20px;
    height: 20px;
    filter: invert(1) drop-shadow(0 0 2px #00ffff);
}

/* Message Styles */
.user-message, .ai-message {
    padding: 1rem;
    border-radius: 10px;
    max-width: 90%;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease-in-out;
}

.user-message {
    background: rgba(138, 43, 226, 0.3);
    border: 1px solid #8A2BE2;
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.3);
}

.ai-message {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #00ffff;
    align-self: flex-start;
    margin-right: auto;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Markdown styling */
.ai-message code {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.9em;
}

.ai-message pre {
    background: rgba(0, 0, 0, 0.5);
    padding: 1em;
    border-radius: 5px;
    overflow-x: auto;
    margin: 0.5em 0;
}

.ai-message pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: block;
}

.ai-message h1, .ai-message h2, .ai-message h3 {
    color: #00ffff;
    margin: 0.5em 0;
}

.ai-message blockquote {
    border-left: 3px solid #8A2BE2;
    margin: 0.5em 0;
    padding-left: 1em;
    color: rgba(255, 255, 255, 0.8);
}

.ai-message a {
    color: #00ffff;
    text-decoration: underline;
}

.ai-message ul, .ai-message ol {
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.ai-message strong {
    color: #00ffff;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gorok-container {
        padding: 0.75rem;
        margin-top: 60px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .gorok-main {
        flex-direction: column;
        height: auto;
        gap: 0.75rem;
        width: 100%;
    }
    
    .conversations-sidebar {
        width: 100%;
        height: auto;
        max-height: 180px;
        overflow-y: auto;
    }
    
    .chat-section {
        height: calc(100vh - 300px);
        min-height: 400px;
        width: 100%;
    }
    
    .chat-container {
        height: calc(100% - 50px);
    }
    
    .chat-output {
        height: calc(100% - 60px);
    }
    
    .chat-input-container {
        padding: 0.5rem;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(0, 0, 0, 0.8);
        z-index: 100;
        box-sizing: border-box;
    }
    
    .chat-input {
        font-size: 1rem;
        width: calc(100% - 100px);
    }
    
    #send-button, #new-chat-button, .delete-conversation-button {
        min-width: 36px;
        min-height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .button-text {
        font-size: 1.2rem;
    }
    
    .user-message, .ai-message {
        padding: 0.75rem;
        max-width: 95%;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button Text Styles */
.button-text {
    font-size: 1.5rem;
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    font-family: 'Audiowide', cursive;
    line-height: 1;
}

#new-chat-button .button-text {
    font-size: 1.8rem;
}

#send-button .button-text {
    font-size: 1.5rem;
}

.delete-conversation-button .button-text {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: none;
}

.delete-conversation-button:hover .button-text {
    color: #ff4d4d;
    text-shadow: 0 0 5px #ff4d4d;
}

@keyframes neonGlow {
    0% { text-shadow: 0 0 5px #00ffff; }
    50% { text-shadow: 0 0 15px #00ffff, 0 0 25px #00ffff; }
    100% { text-shadow: 0 0 5px #00ffff; }
}