.home-page,
.category-page {
    background-color: #f8f9fa;
}

.hero-gradient-wrapper {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 22%, rgba(250, 219, 95, 0.16), rgba(250, 219, 95, 0) 28%),
        radial-gradient(circle at 82% 18%, rgba(145, 234, 228, 0.22), rgba(145, 234, 228, 0) 26%),
        linear-gradient(130deg, #0f6481 0%, #1582a1 26%, #37aebc 52%, #0c5d79 78%, #0f6481 100%);
    background-size: 140% 140%;
    animation: heroGradientFlow 6.6s ease-in-out infinite alternate;
}

.hero-surface {
    position: absolute;
    inset: -8%;
    pointer-events: none;
}

.hero-surface--base {
    background:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 24%),
        radial-gradient(circle at 64% 34%, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0) 18%),
        linear-gradient(115deg, rgba(7, 33, 52, 0.22), rgba(255, 255, 255, 0.02) 36%, rgba(4, 40, 61, 0.16) 100%);
    mix-blend-mode: screen;
    opacity: 0.9;
    animation: heroBasePulse 5.4s ease-in-out infinite;
}

.hero-surface--grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.08));
    opacity: 0.12;
    transform: perspective(900px) rotateX(66deg) translateY(-10%);
    transform-origin: center top;
    animation: heroGridDrift 8.4s linear infinite;
}

.hero-surface--glow {
    border-radius: 999px;
    filter: blur(12px);
    opacity: 0.8;
    will-change: transform;
}

.hero-surface--glow-a {
    top: 6%;
    left: -4%;
    width: 26rem;
    height: 26rem;
    background: radial-gradient(circle, rgba(123, 132, 209, 0.34) 0%, rgba(123, 132, 209, 0) 72%);
    animation: heroFloatA 6s ease-in-out infinite;
}

.hero-surface--glow-b {
    top: 12%;
    right: 10%;
    width: 22rem;
    height: 22rem;
    background: radial-gradient(circle, rgba(145, 234, 228, 0.3) 0%, rgba(145, 234, 228, 0) 72%);
    animation: heroFloatB 7.2s ease-in-out infinite;
}

.hero-surface--glow-c {
    right: -3%;
    bottom: -14%;
    width: 30rem;
    height: 30rem;
    background: radial-gradient(circle, rgba(247, 140, 107, 0.18) 0%, rgba(247, 140, 107, 0) 74%);
    animation: heroFloatC 7.8s ease-in-out infinite;
}

.ag-hero {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 650px;
    max-height: 850px;
    overflow: visible;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 120px 0 80px;
}

@keyframes heroGradientFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 100% 50%;
    }
}

@keyframes heroBasePulse {
    0%, 100% {
        transform: scale(1) translate3d(0, 0, 0);
        opacity: 0.82;
    }

    50% {
        transform: scale(1.04) translate3d(0, -10px, 0);
        opacity: 0.96;
    }
}

@keyframes heroGridDrift {
    0%, 100% {
        transform: perspective(900px) rotateX(66deg) translateY(-10%) translateX(0);
    }

    50% {
        transform: perspective(900px) rotateX(66deg) translateY(-8%) translateX(-18px);
    }
}

@keyframes heroFloatA {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(26px, 18px, 0) scale(1.08);
    }
}

@keyframes heroFloatB {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-20px, 24px, 0) scale(1.06);
    }
}

@keyframes heroFloatC {
    0%, 100% {
        transform: translate3d(0, 0, 0) scale(1);
    }

    50% {
        transform: translate3d(-28px, -14px, 0) scale(1.05);
    }
}

.ag-title {
    color: #fff;
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
    text-align: center;
}

.ag-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 2.1rem;
    font-weight: 500;
    white-space: nowrap;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 160px;
    text-align: center;
}

.ag-chat-widget {
    --chat-mode-font-size: 1.125rem;
    --chat-content-font-size: 1.21rem;
    --chat-file-font-size: 0.935rem;
    --chat-side-action-offset: 20px;
    --chat-side-rail-width: 34px;
    --chat-input-base-height: 84px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ag-chat-fullscreen-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 12, 24, 0.28);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
    z-index: 2890;
}

.ag-chat-fullscreen-backdrop.visible {
    opacity: 1;
    pointer-events: auto;
}

.ag-chat-fullscreen-backdrop.chat-theme-light {
    background: rgba(15, 23, 42, 0.16);
}

.ag-chat-panel {
    position: relative;
    width: 70%;
    max-width: 1100px;
    min-height: 100px;
    background: rgba(35, 40, 48, 0.42);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 24px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ag-chat-widget[data-variant="home"] .ag-chat-panel {
    min-height: 210px;
    height: auto;
    padding-top: 26px;
}

.ag-chat-panel.fullscreen-mode {
    position: fixed !important;
    top: 72px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    height: calc(100vh - 96px) !important;
    width: min(88vw, 1280px) !important;
    max-width: 1280px;
    border-radius: 28px;
    background: rgba(35, 40, 48, 0.96);
    z-index: 2900;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.32);
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.ag-chat-panel.fullscreen-mode.chat-theme-light {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.22);
}

.ag-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
    font-size: 0.95rem;
    font-weight: 700;
}

.ag-chat-header a {
    color: inherit;
    text-decoration: none;
}

.ag-chat-header .cat-name {
    font-size: 0.95rem;
    font-weight: 700;
}

.ag-top-categories {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 100%;
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: space-between;
}

.ag-file-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    width: 100%;
}

.ag-file-list:empty {
    display: none;
}

.ag-file-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--chat-file-font-size);
    color: #fff;
}

.ag-file-remove {
    width: 20px;
    height: 20px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.78);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 4px;
}

.ag-file-remove:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.ag-chat-top {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 0; /* Boşluk alt panele devredildi */
    flex: 1;
    min-height: 0;
}

.ag-chat-input-wrap {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding-right: 48px; /* Scrollbar'ı butonların soluna it (48px boşluk) */
}

.ag-chat-input {
    box-sizing: border-box;
    background: transparent;
    border: none;
    color: rgba(226, 232, 240, 0.9);
    font-size: var(--chat-content-font-size);
    font-weight: 500;
    letter-spacing: 0.15px;
    line-height: 1.45;
    width: 100%;
    flex-grow: 1;
    resize: none;
    outline: none;
    padding: 0 8px 0 10px; /* Wrapper zaten metni uzaklaştırıyor */
    font-family: inherit;
    min-height: var(--chat-input-base-height);
    height: var(--chat-input-base-height);
    max-height: var(--chat-input-base-height);
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.ag-chat-input.has-scrollbar {
    overflow-y: auto;
}

.ag-chat-panel.fullscreen-mode .ag-chat-top {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input-wrap {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    display: flex;
    align-items: stretch;
    padding-right: 64px;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input {
    height: 100% !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow-y: hidden !important;
    padding: 8px 12px 0 10px;
    line-height: 1.7;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input:not(.has-scrollbar) {
    scrollbar-width: none;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input:not(.has-scrollbar)::-webkit-scrollbar {
    width: 0;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input.has-scrollbar {
    overflow-y: auto !important;
    scrollbar-width: auto;
    scrollbar-color: rgba(96, 165, 250, 0.82) rgba(148, 163, 184, 0.22);
}

.ag-chat-panel.fullscreen-mode .ag-chat-input::-webkit-scrollbar {
    width: 12px;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    margin: 0;
}

.ag-chat-panel.fullscreen-mode .ag-chat-input::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.82);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.18);
}

.ag-chat-panel.fullscreen-mode .ag-chat-input::-webkit-scrollbar-thumb:hover {
    background: rgba(59, 130, 246, 0.95);
}

.ag-chat-panel.fullscreen-mode .btn-fullscreen {
    top: 8px;
    right: 10px;
    opacity: 1;
    pointer-events: auto;
    color: rgba(255, 255, 255, 0.82);
}

.ag-chat-panel.fullscreen-mode .ag-chat-bottom {
    margin-top: 0;
    padding-top: 14px;
}

.ag-chat-panel.fullscreen-mode .ag-chat-header,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-header {
    margin-bottom: 12px;
}

.ag-chat-panel.fullscreen-mode .ag-file-list:empty {
    display: none;
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-header,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-header a,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-header .cat-name,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-btn-add,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-btn-send,
.ag-chat-panel.fullscreen-mode.chat-theme-light .btn-fullscreen,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-mode-btn.active,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-search-filter,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input {
    color: #0f172a;
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input::placeholder {
    color: rgba(51, 65, 85, 0.62);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-mode-btn {
    color: rgba(51, 65, 85, 0.72);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-mode-btn.active,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-btn-add:hover,
.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-btn-send:hover,
.ag-chat-panel.fullscreen-mode.chat-theme-light .btn-fullscreen:hover {
    background: rgba(37, 99, 235, 0.12);
    color: #0f172a;
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-search-filter {
    background: rgba(226, 232, 240, 0.82);
    border-color: rgba(148, 163, 184, 0.28);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-add-file-menu {
    background: rgba(255, 255, 255, 0.98);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.16);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-add-menu-item {
    color: #0f172a;
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-add-menu-item:hover {
    background: rgba(37, 99, 235, 0.08);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input::-webkit-scrollbar-track {
    background: rgba(210, 218, 232, 0.9);
    border-radius: 999px;
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input.has-scrollbar {
    scrollbar-color: rgba(163, 184, 219, 0.95) rgba(210, 218, 232, 0.9);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input::-webkit-scrollbar-thumb {
    background: rgba(163, 184, 219, 0.95);
    border: 2px solid rgba(210, 218, 232, 0.9);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 175, 220, 1);
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input::-webkit-scrollbar-button {
    display: block;
    width: 12px;
    height: 12px;
    background-color: rgba(210, 218, 232, 0.9);
    border-radius: 999px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 7px 7px;
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input::-webkit-scrollbar-button:single-button:vertical:decrement {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' viewBox='0 0 7 7'%3E%3Cpath d='M3.5 1.2 6 4.8H1z' fill='%2391b4f6'/%3E%3C/svg%3E");
}

.ag-chat-panel.fullscreen-mode.chat-theme-light .ag-chat-input::-webkit-scrollbar-button:single-button:vertical:increment {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='7' viewBox='0 0 7 7'%3E%3Cpath d='M1 2.2h5L3.5 5.8z' fill='%2391b4f6'/%3E%3C/svg%3E");
}

.ag-chat-input::-webkit-scrollbar {
    width: 6px;
    z-index: 10;
}

.ag-chat-input::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    margin-top: 0; /* Tam Ekran butonunun hizasından başlat */
    margin-bottom: -45px; /* Gönder butonunun altına kadar tüm hattı kapsa */
}

.ag-chat-input::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 999px;
}

.ag-chat-input::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.42);
}

.ag-chat-input::placeholder {
    color: rgba(226, 232, 240, 0.6);
}

.ag-search-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 1.15rem;
    font-weight: 500;
    margin-right: 10px;
    margin-top: 4px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ag-search-filter.hidden {
    display: none !important;
}

.ag-search-filter-close,
.ag-btn-add,
.ag-btn-send,
.btn-fullscreen {
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-fullscreen {
    position: absolute;
    top: 0; /* Scroll ile aynı dikey eksende başla */
    right: 0; /* Butonları pivot olarak en sağa yasla */
    color: rgba(255, 255, 255, 0.6);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, background-color 0.2s ease;
    z-index: 15;
}

.btn-fullscreen.visible {
    opacity: 1;
    pointer-events: auto;
}

.ag-chat-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    position: relative;
    z-index: 5;
    background: transparent;
    padding-top: 10px; 
}

.ag-chat-actions-right {
    display: flex;
    align-items: center;
    width: 35px;
    justify-content: center;
    /* absolute positioning kaldırıldı, normal flex akışına bırakıldı (simetri ve hizalama için) */
}

.ag-chat-actions-left {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.ag-btn-add,
.ag-btn-send {
    color: rgba(255, 255, 255, 0.8);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ag-btn-send.active,
.ag-btn-add:hover,
.ag-btn-send:hover,
.btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.ag-mode-toggles {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ag-mode-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 10px 18px;
    border-radius: 25px;
    font-size: var(--chat-mode-font-size);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.ag-mode-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.ag-add-file-menu {
    position: absolute;
    top: 120%;
    left: 0;
    background: #1e1e20;
    border-radius: 12px;
    padding: 8px 0;
    min-width: 220px;
    display: none;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1000;
}

.ag-add-file-menu.show {
    display: flex;
}

.ag-add-menu-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    cursor: pointer;
}

.ag-chat-panel.search-mode-active .ag-chat-input {
    min-height: var(--chat-input-base-height) !important;
    height: var(--chat-input-base-height) !important;
    max-height: var(--chat-input-base-height) !important;
}

body.chat-fullscreen-active {
    overflow: hidden;
    height: 100vh;
}

@media (max-width: 991px) {
    .hero-surface--grid {
        background-size: 48px 48px;
        opacity: 0.14;
    }

    .hero-surface--glow-a,
    .hero-surface--glow-b,
    .hero-surface--glow-c {
        filter: blur(16px);
    }

    .ag-title {
        font-size: 2.8rem;
    }

    .ag-subtitle {
        white-space: normal;
        margin-bottom: 110px;
        font-size: 1.6rem;
    }

    .ag-top-categories {
        position: static;
        flex-wrap: wrap;
        justify-content: center;
        margin-bottom: 20px;
    }

    .ag-chat-panel {
        width: 92%;
    }

    .ag-chat-input {
        font-size: 1.05rem;
        min-height: 78px;
        height: 78px;
        max-height: 78px;
    }

    .ag-mode-btn {
        font-size: 0.84rem;
        padding: 8px 12px;
    }

    .btn-fullscreen {
        right: 16px;
    }

    .ag-chat-actions-right {
        margin-right: 5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-gradient-wrapper,
    .hero-surface--base,
    .hero-surface--grid,
    .hero-surface--glow-a,
    .hero-surface--glow-b,
    .hero-surface--glow-c {
        animation: none;
    }

    .hero-surface--grid,
    .hero-surface--glow {
        transform: none !important;
    }
}
