/* ========================================
   AI CHATBOT STYLES
   Premium Floating Chatbot UI - Ycotes AI
   ======================================== */

/* Chatbot Logo Styles */
.chatbot-trigger .chatbot-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.chatbot-header-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

/* Login Modal */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.login-modal.active {
    opacity: 1;
    visibility: visible;
}

.login-modal-content {
    background: var(--bg-card);
    border: 1px solid var(--primary-gold);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.login-modal-header {
    margin-bottom: 1.5rem;
}

.login-modal-header img {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
}

.login-modal-header h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
}

.login-modal-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.login-modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-login,
.btn-signup {
    padding: 0.875rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.btn-login {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-amber));
    color: #000;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-gold);
}

.btn-signup {
    background: transparent;
    border: 2px solid var(--primary-gold);
    color: var(--primary-gold);
}

.btn-signup:hover {
    background: var(--primary-gold);
    color: #000;
}

.login-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.login-modal-close:hover {
    background: var(--primary-gold);
    color: #000;
}

/* Stats Section */
.subject-stats {
    padding: 2rem 5%;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.stat-cards {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: var(--primary-gold);
    transform: translateY(-3px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary-gold);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* PYQ Empty State */
.pyq-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
}

.pyq-empty .empty-icon {
    font-size: 3rem;
    color: var(--text-tertiary);
    margin-bottom: 1rem;
}

.pyq-empty h4 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.pyq-empty p {
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

/* Empty State on Index */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state .empty-icon {
    font-size: 4rem;
    color: var(--primary-gold);
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-secondary);
}

/* ========================================
   CHATBOT MODAL
   ======================================== */
.chatbot-modal {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 420px;
    max-height: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.chatbot-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.chatbot-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 600px;
}

.chatbot-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-amber));
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #000;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
}

.chatbot-title i {
    font-size: 1.3rem;
}

.chatbot-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chatbot-close:hover {
    background: rgba(0, 0, 0, 0.2);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 300px;
    max-height: 380px;
}

.message {
    display: flex;
    gap: 0.75rem;
    max-width: 90%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-amber));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 1rem;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.message-content {
    background: var(--bg-tertiary);
    padding: 1rem 1.25rem;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}

.message.user .message-content {
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-amber));
    color: #000;
    border-radius: 16px;
    border-bottom-right-radius: 4px;
}

.message-content p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0;
}

.message.user .message-content p {
    color: #000;
}

.message-content ul {
    margin: 0.75rem 0 0;
    padding-left: 1.2rem;
}

.message-content li {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.chatbot-input-container {
    padding: 1rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.quick-action {
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action:hover {
    border-color: var(--primary-gold);
    color: var(--primary-gold);
    background: rgba(212, 175, 55, 0.1);
}

.chatbot-input {
    display: flex;
    gap: 0.75rem;
}

.chatbot-input input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.chatbot-input input::placeholder {
    color: var(--text-tertiary);
}

.chatbot-input input:focus {
    outline: none;
    border-color: var(--primary-gold);
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--primary-gold), var(--secondary-amber));
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-gold);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.3rem;
    padding: 0.75rem 1rem;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-gold);
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Completed Topic */
.topic-card.completed {
    background: rgba(34, 197, 94, 0.05);
    border-color: rgba(34, 197, 94, 0.3);
}

.topic-card.completed .topic-title {
    color: var(--text-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .stat-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .chatbot-modal {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 20px 20px 0 0;
    }

    .chatbot-messages {
        max-height: calc(70vh - 180px);
    }
}

@media (max-width: 480px) {
    .stat-cards {
        grid-template-columns: 1fr 1fr;
    }
}