/* public/css/style.css */

:root {
    --color-primary: #0f766e;
    --color-secondary: #f59e0b;
    --color-accent: #16a34a;
    --background-color: #f7fbf8;
    --text-color: #1f2937;
    --button-radius: 14px;
    --friendly-primary: #0f766e;
    --friendly-primary-dark: #115e59;
    --friendly-secondary: #f59e0b;
    --friendly-accent: #16a34a;
    --friendly-soft: #ecfdf5;
    --friendly-warm: #fff7ed;
    --friendly-border: #d7eee7;
    --gradient: linear-gradient(135deg, #0f766e 0%, #16a34a 64%, #f59e0b 132%);
}

* { box-sizing: border-box; }

body {
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: #f7fbf8;
    color: var(--text-color);
}

.navbar-glass {
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(215, 238, 231, 0.9);
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.07);
}

.bg-brand-gradient {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.97) 0%, rgba(22, 163, 74, 0.92) 62%, rgba(245, 158, 11, 0.88) 132%);
}

.btn-primary {
    background: linear-gradient(135deg, var(--friendly-primary) 0%, var(--friendly-accent) 100%);
    border-radius: var(--button-radius);
    display: inline-block;
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.16);
    transition: box-shadow 0.2s, transform 0.2s, background 0.2s;
}

a,
.nav-link:hover,
.text-purple-600 {
    color: var(--friendly-primary);
}

.border-purple-500 {
    border-color: var(--friendly-primary) !important;
}

.bg-purple-600,
.peer:checked ~ .peer-checked\:bg-purple-500 {
    background: var(--friendly-primary) !important;
}

.text-purple-300,
.text-purple-500,
.text-purple-700 {
    color: var(--friendly-primary) !important;
}

.bg-purple-50,
.bg-purple-100 {
    background: var(--friendly-soft) !important;
}

.bg-indigo-50 {
    background: var(--friendly-warm) !important;
}

.border-purple-100,
.border-purple-200,
.border-purple-300,
.border-purple-400 {
    border-color: var(--friendly-border) !important;
}

.focus\:border-purple-400:focus,
.focus\:border-purple-500:focus {
    border-color: var(--friendly-primary) !important;
}

.focus\:ring-purple-50:focus,
.focus\:ring-purple-100:focus {
    --tw-ring-color: rgba(15, 118, 110, 0.1) !important;
}

.group:hover .group-hover\:text-purple-600,
.hover\:text-purple-600:hover {
    color: var(--friendly-primary-dark) !important;
}

.group:hover .group-hover\:bg-purple-600 {
    background: var(--friendly-primary) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--friendly-primary-dark) 0%, #15803d 100%);
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.2);
    transform: translateY(-1px);
}

.filter-btn {
    background: #f3f4f6;
    color: #6b7280;
    border: 2px solid transparent;
    transition: all 0.25s;
    cursor: pointer;
}

.filter-btn:hover {
    background: var(--friendly-soft);
    color: var(--friendly-primary);
    border-color: var(--friendly-border);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--friendly-primary) 0%, var(--friendly-accent) 100%);
    color: #ffffff;
    border-color: transparent;
}

.product-card,
.project-card {
    transition: box-shadow 0.3s, transform 0.3s;
}

.product-card:hover,
.project-card:hover,
a.bg-white:hover {
    box-shadow: 0 18px 40px rgba(31, 41, 55, 0.09) !important;
}

.hero-section {
    min-height: calc(100vh - 2.5rem);
    background: #f7fbf8;
}

.hero-section .hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0)),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 96px);
    opacity: 0.45;
}

.hero-section h1 {
    letter-spacing: 0;
}

.hero-section .bg-white\/15 {
    background: rgba(255, 255, 255, 0.18) !important;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

input[type="file"]::file-selector-button {
    background: linear-gradient(135deg, var(--friendly-primary) 0%, var(--friendly-accent) 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    margin-right: 8px;
    transition: opacity 0.2s;
}

input[type="file"]::file-selector-button:hover {
    opacity: 0.9;
}

input[type="checkbox"].sr-only:checked + div {
    background: var(--friendly-primary) !important;
}

input[type="checkbox"].sr-only:checked + div + div {
    transform: translateX(20px);
}

.prose p { margin-bottom: 1rem; }
.prose h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
.prose ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; }

#sidebar a.active {
    background: rgba(255, 255, 255, 0.22);
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

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

.fade-in-up {
    animation: fadeInUp 0.5s ease-out;
}

@media (max-width: 768px) {
    #sidebar { display: none; }
    #sidebar.open {
        display: flex;
        position: fixed;
        z-index: 50;
        width: 260px;
        height: 100vh;
        top: 0;
        left: 0;
    }
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px 0;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.15s;
}

.share-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.share-fb { background: #1877F2; }
.share-wa { background: #25D366; }
.share-ig { background: linear-gradient(135deg, #f09433, #dc2743, #bc1888); }
.share-copy { background: #374151; }

.share-feedback {
    width: 100%;
    font-size: 12px;
    color: #22c55e;
}

.share-feedback.hidden {
    display: none;
}

.agent-screen {
    height: calc(100dvh - 128px);
    min-height: 620px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    min-height: 0;
}

.agent-topbar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 0 0 auto;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #ffffff;
}

.agent-topbar-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.agent-title-block {
    min-width: 0;
}

.agent-title-block h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 750;
    color: #111827;
}

.agent-title-block p {
    margin: 2px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #64748b;
}

.agent-status-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    font-size: 11px;
    scrollbar-width: thin;
}

.agent-status-strip span {
    flex: 0 0 auto;
    line-height: 1.1;
    white-space: nowrap;
}

.agent-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.agent-top-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 650;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.agent-top-action:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.agent-top-action-danger {
    border-color: #fecaca;
    color: #b91c1c;
}

.agent-top-action-danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.agent-layout {
    display: grid;
    grid-template-columns: minmax(230px, 270px) minmax(0, 1fr);
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
}

.agent-sidebar {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f8fafc;
}

.agent-sidebar-head,
.agent-chat-head {
    padding: 14px 18px;
}

.agent-sidebar-head h2,
.agent-chat-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.agent-sidebar-head p,
.agent-chat-head p {
    margin: 3px 0 0;
    font-size: 12px;
}

.agent-sidebar-head p {
    display: none;
}

.agent-conversations-list {
    padding: 0 10px 10px;
    overflow-y: auto;
}

.agent-conversation-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 16px;
    background: transparent;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
    cursor: pointer;
    margin-bottom: 6px;
}

.agent-conversation-open {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.agent-conversation-item:hover,
.agent-conversation-item.active {
    background: #ffffff;
    border-color: #ddd6fe;
    transform: translateY(-1px);
}

.agent-conversation-item strong,
.agent-conversation-item span {
    display: block;
}

.agent-conversation-item strong {
    color: #111827;
    font-size: 13px;
    margin-bottom: 3px;
}

.agent-conversation-item span {
    color: #6b7280;
    font-size: 11px;
}

.agent-conversation-actions {
    display: inline-flex !important;
    gap: 4px;
}

.agent-conversation-actions button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    cursor: pointer;
}

.agent-conversation-actions button:hover {
    background: #e5e7eb;
    color: #111827;
}

.agent-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.agent-meta-badges span {
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    padding: 4px 9px;
    font-size: 11px;
    font-weight: 700;
}

.agent-chat {
    padding: 10px;
    min-width: 0;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
}

.agent-chat-wrapper {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    border: 1px solid #e8edf4;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.agent-messages {
    min-height: 0;
    overflow-y: auto;
    padding: 18px 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fbfcfe;
}

.agent-message {
    display: flex;
}

.agent-message-user {
    justify-content: flex-end;
}

.agent-message-agent {
    justify-content: flex-start;
}

.agent-bubble {
    max-width: min(78%, 860px);
    padding: 13px 15px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.55;
    white-space: normal;
}

.agent-bubble-user {
    background: #0f172a;
    color: #ffffff;
    border-top-right-radius: 8px;
}

.agent-bubble-agent {
    background: #eef6f4;
    color: #12332d;
    border-top-left-radius: 8px;
    border: 1px solid #d9ebe7;
}

.agent-bubble-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.agent-inline-actions {
    margin-left: 12px;
    align-self: flex-end;
}

.agent-confirm-btn {
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.agent-confirm-btn:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.agent-typing {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.agent-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0f766e;
    animation: agentTyping 1s infinite ease-in-out;
}

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

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

.agent-action-banner {
    display: none;
    margin: 0 22px 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 13px;
    font-weight: 700;
}

.agent-action-banner.visible {
    display: block;
}

@keyframes agentTyping {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

.agent-quick-replies {
    min-height: 36px;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.agent-quick {
    flex: 0 0 auto;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #ffffff;
    color: #374151;
    padding: 7px 11px;
    font-size: 12px;
    transition: background 0.2s, border-color 0.2s;
}

.agent-quick:hover {
    background: #ecfdf5;
    border-color: #99f6e4;
}

.agent-input-area {
    min-height: 76px;
    border-top: 1px solid #e5e7eb;
    padding: 12px 14px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.agent-composer-row {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr) auto;
    align-items: stretch;
    gap: 10px;
    min-height: 54px;
}

.agent-drop-zone {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 7px 9px;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #374151;
    cursor: pointer;
    min-width: 0;
}

.agent-drop-zone.dragover {
    background: #eef2ff;
    border-color: #6366f1;
}

.agent-drop-zone span {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
}

.agent-drop-zone small {
    color: #6b7280;
    font-size: 10px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-input {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.35;
    outline: none;
    min-height: 54px;
    max-height: 130px;
    resize: none;
    background: #fff;
}

.agent-input:focus {
    border-color: #0f766e;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
}

.agent-send-btn,
.agent-input-area button.agent-send-btn {
    align-self: stretch;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 112px;
    padding: 0 18px;
    background: #0f766e;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
}

.agent-send-btn:hover,
.agent-input-area button.agent-send-btn:hover {
    background: #115e59;
}

@media (max-width: 980px) {
    .agent-screen {
        height: auto;
        min-height: calc(100dvh - 118px);
    }

    .agent-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(130px, 180px) minmax(520px, 1fr);
    }

    .agent-sidebar {
        border-right: 0;
        border-bottom: 1px solid #f3f4f6;
    }

    .agent-messages {
        min-height: 0;
    }

    .agent-conversations-list {
        max-height: none;
    }
}

@media (max-width: 640px) {
    .agent-topbar-main {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .agent-top-actions {
        width: 100%;
    }

    .agent-top-action {
        flex: 1;
        min-width: 0;
        padding: 0 10px;
    }

    .agent-title-block h1 {
        font-size: 20px;
    }

    .agent-title-block p {
        font-size: 12px;
    }

    .agent-layout {
        grid-template-rows: minmax(120px, 170px) minmax(500px, 1fr);
    }

    .agent-chat {
        padding: 10px;
    }

    .agent-chat-wrapper {
        height: 100%;
        max-height: none;
        min-height: 0;
    }

    .agent-sidebar-head,
    .agent-chat-head,
    .agent-messages,
    .agent-quick-replies {
        padding-left: 14px;
        padding-right: 14px;
    }

    .agent-bubble {
        max-width: 100%;
    }

    .agent-input-area {
        flex-direction: column;
    }

    .agent-composer-row {
        grid-template-columns: 1fr;
    }

    .agent-send-btn,
    .agent-input-area button.agent-send-btn {
        width: 100%;
        min-height: 46px;
    }

    .agent-drop-zone {
        min-height: 44px;
    }
}
