/* Main chat container */
#claude-chat {
    max-width: 800px;
    margin: 20px auto;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.chat-header h2 {
    margin: 0 0 10px 0;
    color: #333;
}

.chat-info {
    font-size: 0.9em;
    color: #666;
}

/* Messages container */
#chat-messages {
    height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
}

/* Message styling */
.message {
    margin-bottom: 15px;
    max-width: 80%;
    clear: both;
}

.message .text {
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    line-height: 1.5;
}

.message.user {
    float: right;
}

.message.user .text {
    background: #007bff;
    color: white;
    border-radius: 18px 18px 0 18px;
}

.message.assistant {
    float: left;
}

.message.assistant .text {
    background: white;
    border: 1px solid #ddd;
    border-radius: 18px 18px 18px 0;
}

.message.typing .text {
    border-right: 2px solid #007bff;
    animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
    0%, 100% { border-right-color: transparent; }
    50% { border-right-color: #007bff; }
}

.message.error .text {
    background: #dc3545;
    color: white;
    text-align: center;
    border-radius: 8px;
}

/* Input area */
#chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #ddd;
    gap: 10px;
}

#message-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 24px;
    resize: none;
    min-height: 48px;
    font-size: 16px;
}

#message-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

#send-message {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

#send-message:hover {
    background: #0056b3;
}

#send-message:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.product-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-card h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.product-description {
    color: #666;
    margin-bottom: 15px;
}

.product-price {
    font-size: 1.5em;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 10px;
}

.product-duration {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 20px;
}

.purchase-button {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-size: 16px;
    transition: background 0.2s;
}

.purchase-button:hover {
    background: #0056b3;
    color: white;
}

/* My Chats page */
.my-chats {
    max-width: 1200px;
    margin: 20px auto;
}

.chats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.chat-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.chat-card.expiring-soon {
    border-color: #ffc107;
}

.days-left {
    font-weight: bold;
    color: #28a745;
    margin-bottom: 5px;
}

.expiring-soon .days-left {
    color: #ffc107;
}

.expiry-date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.open-chat-button {
    display: inline-block;
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.2s;
}

.open-chat-button:hover {
    background: #0056b3;
    color: white;
    text-decoration: none;
}

.no-chats {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

/* Clear fix for float layout */
.message:after {
    content: '';
    display: table;
    clear: both;
}