/* AI Phong Thuy Plugin Styles - v3.0 (Modular & Inline Support) */

:root {
    /* Dark Mode (Default) */
    --apt-primary-bg: rgba(20, 20, 35, 0.95);
    --apt-secondary-bg: rgba(30, 30, 50, 0.6);
    --apt-accent: #ffd700;
    --apt-accent-glow: rgba(255, 215, 0, 0.3);
    --apt-text-main: #ffffff;
    --apt-text-muted: #a0a0b0;
    --apt-border: rgba(255, 255, 255, 0.1);
    --apt-msg-user-bg: rgba(255, 215, 0, 0.2);
    --apt-msg-ai-bg: rgba(255, 255, 255, 0.1);

    --apt-font-heading: 'Cinzel', serif;
    --apt-font-body: 'Inter', sans-serif;
    --apt-transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

[data-theme="light"] {
    --apt-primary-bg: rgba(255, 255, 255, 0.95);
    --apt-secondary-bg: rgba(240, 242, 245, 0.8);
    --apt-accent: #b8860b;
    /* Darker Gold */
    --apt-accent-glow: rgba(184, 134, 11, 0.2);
    --apt-text-main: #1a1a2e;
    --apt-text-muted: #666666;
    --apt-border: rgba(0, 0, 0, 0.1);
    --apt-msg-user-bg: rgba(184, 134, 11, 0.15);
    --apt-msg-ai-bg: rgba(0, 0, 0, 0.05);
}

/* Reset */
#ai-phongthuy-plugin-root * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Floating Toggle Button */
.apt-toggle-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2b1055, #7597de);
    border: 2px solid var(--apt-accent);
    box-shadow: 0 0 20px var(--apt-accent-glow);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--apt-transition);
    animation: apt-float 3s ease-in-out infinite;
}

.apt-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px var(--apt-accent-glow);
}

.apt-toggle-btn svg {
    width: 30px;
    height: 30px;
    color: white;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

@keyframes apt-float {

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

    50% {
        transform: translateY(-10px);
    }
}

/* Main Panel */
.apt-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 400px;
    height: 650px;
    background: linear-gradient(160deg, rgba(20, 20, 35, 0.95), rgba(43, 16, 85, 0.9));
    border-radius: 20px;
    border: 1px solid rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(25px);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 215, 0, 0.05);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: var(--apt-transition);
    font-family: var(--apt-font-body);
}

/* Nebula Effect Background */
.apt-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 50%, rgba(117, 151, 222, 0.1), transparent 60%),
        radial-gradient(circle at 80% 20%, rgba(255, 215, 0, 0.05), transparent 40%);
    animation: apt-nebula-move 20s linear infinite;
    z-index: -1;
    pointer-events: none;
}

@keyframes apt-nebula-move {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.apt-panel.apt-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */
.apt-header {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.apt-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.apt-title {
    font-family: var(--apt-font-heading);
    color: var(--apt-accent);
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.apt-icon-btn {
    background: none;
    border: none;
    color: var(--apt-text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.apt-icon-btn:hover {
    color: var(--apt-text-main);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

/* Navigation Tabs */
.apt-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px;
    gap: 5px;
    position: relative;
    z-index: 2;
}

.apt-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 8px;
    color: var(--apt-text-muted);
    font-family: var(--apt-font-body);
    font-size: 0.8rem;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.apt-tab.apt-active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--apt-accent);
    box-shadow: inset 0 0 10px rgba(255, 215, 0, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.1);
}

/* Content Area */
.apt-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* Feature List */
.apt-feature-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.apt-feature-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

.apt-feature-card:hover {
    border-color: var(--apt-accent);
    transform: translateX(5px);
    background: rgba(255, 215, 0, 0.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.1);
}

.apt-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--apt-accent);
    font-size: 1.2rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.apt-feature-info h3 {
    font-size: 0.9rem;
    color: var(--apt-text-main);
    margin-bottom: 2px;
    font-weight: 600;
}

.apt-feature-info p {
    font-size: 0.75rem;
    color: var(--apt-text-muted);
}

/* Feature Detail View */
.apt-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    /* Transparent to show nebula */
    z-index: 10;
    padding: 0;
    transform: translateX(100%);
    transition: var(--apt-transition);
    display: flex;
    flex-direction: column;
}

.apt-view.apt-active {
    transform: translateX(0);
}

.apt-view-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(20, 20, 35, 0.8);
    /* Semi-transparent */
    backdrop-filter: blur(10px);
}

.apt-view-title {
    font-family: var(--apt-font-heading);
    color: var(--apt-text-main);
    font-size: 1rem;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* Form Elements */
.apt-form-container {
    padding: 20px;
    overflow-y: auto;
}

.apt-form-group {
    margin-bottom: 15px;
}

.apt-label {
    display: block;
    color: var(--apt-text-muted);
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.apt-input,
.apt-select,
.apt-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    color: var(--apt-text-main);
    font-family: var(--apt-font-body);
    outline: none;
    transition: 0.3s;
}

.apt-input:focus,
.apt-select:focus,
.apt-textarea:focus {
    border-color: var(--apt-accent);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.1);
    background: rgba(0, 0, 0, 0.3);
}

/* Neon Button */
.apt-btn {
    width: 100%;
    background: linear-gradient(90deg, #ffd700, #b8860b);
    color: #1a1a2e;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.apt-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #b8860b, #ffd700);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.apt-btn:hover::after {
    opacity: 1;
}

.apt-btn:hover {
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

/* Chat Interface */
.apt-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.apt-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.apt-message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.6;
    word-wrap: break-word;
    text-align: justify;
    /* Justify text for even look */
}

.apt-message p {
    margin-bottom: 10px;
}

.apt-message ul {
    padding-left: 20px;
    margin: 10px 0;
    list-style-type: disc;
}

.apt-message li {
    margin-bottom: 5px;
    padding-left: 5px;
}

.apt-message.user {
    align-self: flex-end;
    background: var(--apt-msg-user-bg);
    color: var(--apt-text-main);
    border-bottom-right-radius: 4px;
    text-align: left;
    /* Keep user messages left aligned */
}

.apt-message.ai {
    align-self: flex-start;
    background: var(--apt-msg-ai-bg);
    color: var(--apt-text-main);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--apt-border);
}

.apt-message strong {
    color: var(--apt-accent);
    font-weight: 700;
}

.apt-chat-input-area {
    padding: 15px;
    background: var(--apt-secondary-bg);
    border-top: 1px solid var(--apt-border);
    display: flex;
    gap: 10px;
}

/* Preset Chips */
.apt-presets {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 20px 15px 20px;
    scrollbar-width: none;
    /* Firefox */
}

.apt-presets::-webkit-scrollbar {
    display: none;
}

.apt-chip {
    white-space: nowrap;
    background: var(--apt-secondary-bg);
    border: 1px solid var(--apt-border);
    color: var(--apt-text-muted);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}

.apt-chip:hover {
    border-color: var(--apt-accent);
    color: var(--apt-accent);
    background: rgba(255, 215, 0, 0.05);
}

/* Specialized Result Cards (Horoscope/Dates) */
.apt-result-card {
    background: var(--apt-secondary-bg);
    border: 1px solid var(--apt-accent);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}

.apt-result-header {
    text-align: center;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--apt-border);
    padding-bottom: 10px;
}

.apt-result-header h3 {
    color: var(--apt-accent);
    font-family: var(--apt-font-heading);
    font-size: 1.2rem;
}

/* Markdown Tables Styling */
.apt-message table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 0.85rem;
}

.apt-message th,
.apt-message td {
    border: 1px solid var(--apt-border);
    padding: 8px;
    text-align: left;
}

.apt-message th {
    background: rgba(255, 215, 0, 0.1);
    color: var(--apt-accent);
    font-weight: 600;
}

.apt-message strong {
    color: var(--apt-accent);
}

/* History List */
.apt-history-list {
    padding: 10px;
}

.apt-history-item {
    padding: 10px;
    border-bottom: 1px solid var(--apt-border);
    cursor: pointer;
    transition: 0.2s;
}

.apt-history-item:hover {
    background: var(--apt-secondary-bg);
}

.apt-history-time {
    font-size: 0.7rem;
    color: var(--apt-text-muted);
}

.apt-history-text {
    font-size: 0.85rem;
    color: var(--apt-text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Toast Notification */
.apt-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 20, 35, 0.95);
    color: var(--apt-text-main);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid var(--apt-accent);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease;
}

.apt-toast.error {
    border-color: #ff4d4f;
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .apt-panel {
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        bottom: 0;
        right: 0;
        border-radius: 0;
        max-height: none;
        /* Ensure no max-height constraint */
    }

    /* Extra padding for mobile input to avoid keyboard overlap */
    .apt-content {
        padding-bottom: 80px;
    }

    /* Mobile Result Card Optimization */
    .apt-result-card {
        padding: 15px;
        margin-top: 15px;
    }

    .apt-result-header h3 {
        font-size: 1.1rem;
    }

    .apt-message {
        font-size: 0.95rem;
        line-height: 1.6;
        padding: 10px;
        /* Reduced padding for mobile */
    }

    .apt-message h3 {
        font-size: 1.1rem;
        margin-top: 20px;
        margin-bottom: 10px;
    }

    .apt-message h4 {
        font-size: 1rem;
        margin-top: 15px;
    }

    /* Make tables scrollable horizontally */
    .apt-message table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Adjust input fields for better touch targets */
    .apt-input,
    .apt-select,
    .apt-btn {
        font-size: 16px;
        /* Prevent zoom on iOS */
        padding: 12px;
    }
}

/* CSS for Inline Features */
.apt-inline-feature {
    background: var(--apt-primary-bg);
    border: 1px solid var(--apt-border);
    border-radius: 12px;
    padding: 0;
    margin: 20px 0;
    max-width: 100%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: var(--apt-font-body);
    color: var(--apt-text-main);
}

.apt-inline-feature .apt-view-header {
    background: var(--apt-secondary-bg);
    padding: 15px;
    margin-bottom: 0;
}

.apt-inline-feature .apt-back-btn {
    display: none;
    /* Hide back button for inline mode */
}

/* Loading Overlay */
.apt-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 20, 35, 0.9);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.apt-loading-spinner {
    width: 80px;
    height: 80px;
    position: relative;
    margin-bottom: 20px;
}

.apt-loading-circle {
    width: 100%;
    height: 100%;
    border: 3px solid transparent;
    border-top-color: var(--apt-accent);
    border-radius: 50%;
    animation: apt-spin 1.5s linear infinite;
}

.apt-loading-circle:before {
    content: "";
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    border: 3px solid transparent;
    border-top-color: #7597de;
    border-radius: 50%;
    animation: apt-spin 2s linear infinite reverse;
}

.apt-loading-circle:after {
    content: "";
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 3px solid transparent;
    border-top-color: #ff4d4f;
    border-radius: 50%;
    animation: apt-spin 3s linear infinite;
}

.apt-loading-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    animation: apt-pulse 2s ease-in-out infinite;
}

.apt-loading-text {
    color: var(--apt-accent);
    font-family: var(--apt-font-body);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    min-height: 24px;
    animation: apt-pulse-text 2s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@keyframes apt-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes apt-pulse {

    0%,
    100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(0.9);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

@keyframes apt-pulse-text {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
        text-shadow: 0 0 10px var(--apt-accent-glow);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Loading Wave Animation */
.apt-loading-wave {
    height: 4px;
    width: 100%;
    max-width: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 15px auto 0;
    position: relative;
}

.apt-loading-wave::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, transparent, var(--apt-accent), transparent);
    animation: apt-wave-move 1.5s infinite linear;
}

@keyframes apt-wave-move {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(250%);
    }
}

/* Wizard Form Styles */
.apt-wizard-container {
    padding: 20px;
    position: relative;
    min-height: 300px;
}

.apt-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.apt-step.apt-active {
    display: block;
}

.apt-wizard-question {
    font-family: var(--apt-font-heading);
    color: var(--apt-accent);
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.apt-step-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.apt-step-actions .apt-btn {
    margin-top: 0;
}

.apt-btn-back {
    width: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--apt-border);
    border-radius: 8px;
    color: var(--apt-text-muted);
}

.apt-btn-back:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--apt-text-main);
}

/* Divination Cards */
.apt-card-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    perspective: 1000px;
}

.apt-divination-card {
    width: 80px;
    height: 120px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.6s;
}

.apt-divination-card:hover {
    transform: translateY(-10px);
}

.apt-divination-card.apt-flipped {
    transform: rotateY(180deg) scale(1.1);
}

.apt-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--apt-border);
}

.apt-card-back {
    background: linear-gradient(135deg, #2b1055, #1a1a2e);
    background-image: radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.1) 1px, transparent 1px);
    background-size: 10px 10px;
    color: var(--apt-accent);
    border: 2px solid var(--apt-accent);
}

.apt-card-front {
    background: linear-gradient(135deg, #fff, #f0f0f0);
    color: #333;
    transform: rotateY(180deg);
    border: 2px solid var(--apt-accent);
}

.apt-divination-input {
    margin-bottom: 20px;
    text-align: center;
}

.apt-divination-instruction {
    text-align: center;
    color: var(--apt-text-muted);
    margin-bottom: 20px;
    font-style: italic;
    font-size: 0.9rem;
}

/* Buddhism Chat Features */
.apt-sound-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--apt-text-muted);
    transition: 0.3s;
}

.apt-sound-toggle:hover {
    color: var(--apt-accent);
    transform: scale(1.1);
}

.apt-message.ai {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    background: transparent;
    /* Remove default bg to handle bubble separately if needed, or keep it */
    border: none;
    padding: 0;
}

.apt-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.apt-msg-content {
    background: var(--apt-msg-ai-bg);
    padding: 12px 16px;
    border-radius: 16px;
    border-top-left-radius: 4px;
    border: 1px solid var(--apt-border);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--apt-text-main);
    text-align: justify;
}

/* Calendar View */
.apt-calendar {
    background: var(--apt-secondary-bg);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid var(--apt-border);
}

.apt-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--apt-text-muted);
    font-size: 0.8rem;
}

.apt-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.apt-calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    border: 1px solid transparent;
}

.apt-calendar-day:hover {
    transform: scale(1.05);
    z-index: 2;
}

.apt-day-good {
    background: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #28a745;
}

.apt-day-bad {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    color: #dc3545;
}

.apt-day-neutral {
    color: var(--apt-text-muted);
}

.apt-day-empty {
    background: transparent;
    cursor: default;
}

.apt-day-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--apt-primary-bg);
    border: 1px solid var(--apt-border);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.7rem;
    white-space: nowrap;
    display: none;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.apt-calendar-day:hover .apt-day-tooltip {
    display: block;
}
/* ============================================
   SHARE SECTION STYLES
   ============================================ */

/* Share Section Container */
.apt-share-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--apt-border);
    animation: slideInUp 0.5s ease;
}

.apt-share-title {
    text-align: center;
    color: var(--apt-text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Share Buttons Container */
.apt-share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Individual Share Button */
.apt-share-btn {
    flex: 1;
    min-width: 100px;
    max-width: 150px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--apt-border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: var(--apt-font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--apt-text-main);
    position: relative;
    overflow: hidden;
}

.apt-share-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.apt-share-btn:hover::before {
    left: 100%;
}

.apt-share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.apt-share-btn svg {
    flex-shrink: 0;
}

/* Facebook Button */
.apt-share-facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.apt-share-facebook:hover {
    background: rgba(24, 119, 242, 0.15);
    box-shadow: 0 5px 20px rgba(24, 119, 242, 0.3);
}

/* Zalo Button */
.apt-share-zalo {
    border-color: #0068ff;
    color: #0068ff;
}

.apt-share-zalo:hover {
    background: rgba(0, 104, 255, 0.15);
    box-shadow: 0 5px 20px rgba(0, 104, 255, 0.3);
}

/* Twitter/X Button */
.apt-share-twitter {
    border-color: #1da1f2;
    color: #1da1f2;
}

.apt-share-twitter:hover {
    background: rgba(29, 161, 242, 0.15);
    box-shadow: 0 5px 20px rgba(29, 161, 242, 0.3);
}

/* Copy Link Button */
.apt-share-copy {
    border-color: var(--apt-accent);
    color: var(--apt-accent);
}

.apt-share-copy:hover {
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 5px 20px var(--apt-accent-glow);
}

/* Slide in animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design for Share Buttons */
@media (max-width: 480px) {
    .apt-share-buttons {
        gap: 8px;
    }
    
    .apt-share-btn {
        min-width: auto;
        flex: 1 1 calc(50% - 4px);
        max-width: none;
        font-size: 0.75rem;
        padding: 8px 10px;
    }
    
    .apt-share-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .apt-share-title {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
}

/* Light Theme Adjustments */
[data-theme="light"] .apt-share-btn {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .apt-share-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Make share section visible in message bubbles */
.apt-message.ai .apt-share-section {
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
}

/* Ensure share section works well inside result cards */
.apt-result-card .apt-share-section {
    margin-top: 20px;
    padding-top: 20px;
}
