/* AI Avatar Chat Container */
#ai-avatar-chat-container {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.user-balance {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}

#coin-balance {
    color: #ffd700;
    font-size: 18px;
}

.shop-button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.shop-button:hover {
    background: #ff5252;
    transform: scale(1.05);
}

/* Avatar Canvas */
#avatar-canvas-container {
    flex: 1;
    position: relative;
    min-height: 350px;
}

#avatar-canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Chat Interface */
#chat-interface {
    background: rgba(255,255,255,0.95);
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 200px;
    border-top: 2px solid rgba(0,0,0,0.1);
}

#chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    animation: slideIn 0.3s ease;
}

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

.user-message {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.ai-message {
    background: #e9ecef;
    color: #333;
    margin-right: auto;
}

.message-text {
    display: block;
    word-wrap: break-word;
}

/* Chat Controls */
.chat-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border 0.3s;
}

#chat-input:focus {
    border-color: #667eea;
}

#send-text-btn,
#voice-input-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

#send-text-btn {
    background: #667eea;
    color: white;
}

#send-text-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.voice-btn {
    background: #4caf50;
    color: white;
    font-size: 18px;
}

.voice-btn:hover {
    background: #45a049;
}

.voice-btn.recording {
    background: #f44336;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

#voice-status {
    color: #666;
    font-size: 12px;
}

/* Clothing Shop Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

.close-modal:hover {
    color: #333;
}

.modal-content h2 {
    margin-top: 0;
    color: #333;
    margin-bottom: 25px;
}

/* Shop Items Grid */
#clothing-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.shop-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.shop-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.shop-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.shop-item h4 {
    margin: 10px 0 5px;
    color: #333;
    font-size: 16px;
}

.shop-item p {
    color: #ffd700;
    font-weight: 600;
    margin: 5px 0 10px;
}

.purchase-item-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    width: 100%;
}

.purchase-item-btn:hover {
    background: #5568d3;
}

/* Scrollbar Styling */
#chat-messages::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
    width: 8px;
}

#chat-messages::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ai-avatar-chat-container {
        border-radius: 0;
    }
    
    #chat-interface {
        height: 180px;
    }
    
    #clothing-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .modal-content {
        max-width: 95%;
        padding: 20px;
    }
    
    .chat-controls {
        flex-wrap: wrap;
    }
    
    #chat-input {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Admin Styles */
.clothing-form .form-table th {
    width: 200px;
}

.wp-list-table img {
    border-radius: 5px;
}