:root {
    --background: 224 71% 4%;
    --foreground: 213 31% 91%;
    --card: 224 71% 5%;
    --primary: 210 40% 98%;
    --primary-foreground: 222.2 47.4% 11.2%;
    --muted: 223 47% 11%;
    --muted-foreground: 215.4 16.3% 56.9%;
    --accent: 216 34% 17%;
    --accent-foreground: 210 40% 98%;
    --border: 216 34% 17%;
    --input: 216 34% 17%;
    --ring: 216 34% 17%;
}

:root:not(.dark) {
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 98%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --border: 214.3 31.8% 91.4%;
}

body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}

.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

:root:not(.dark) .glass-card {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.modal-open {
    overflow: hidden;
}

::selection {
    background-color: rgba(34, 211, 238, 0.2);
    color: #22d3ee;
}

.nav-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    color: hsl(var(--muted-foreground));
    background: transparent;
}

.nav-link:hover {
    color: #22d3ee;
}

.social-btn {
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--muted-foreground));
}

.social-btn:hover {
    border-color: #22d3ee;
    background-color: hsla(189, 94%, 43%, 0.1);
    color: #22d3ee;
}

.reveal-hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: hsl(var(--background));
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #22d3ee;
}

#header.scrolled {
    background-color: hsl(var(--background) / 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(var(--border));
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

#sheet-content {
    background-color: #0f172a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 60;
}

#sheet-backdrop {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 59;
}

#sheet-content nav button {
    text-align: left;
    width: 100%;
    padding: 1rem 0.5rem;
    font-size: 1.1rem;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

#sheet-content nav button:hover {
    color: #22d3ee;
    padding-left: 1rem;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.1) 0%, transparent 100%);
}

#sheet-content nav button:last-child {
    border-bottom: none;
}

#sheet-content .menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#sheet-content .close-btn {
    color: #94a3b8;
    transition: color 0.2s;
}

#sheet-content .close-btn:hover {
    color: #fff;
}

@media (max-width: 1024px) {
    .glass-card {
        padding: 1.5rem !important;
    }

    html {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }

    body {
        overflow-x: hidden;
    }

    .glass-card {
        padding: 1rem !important;
        margin-bottom: 1rem;
    }

    #skills-container .grid {
        grid-template-columns: 1fr !important;
    }

    #about-container {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .project-card {
        margin: 0 0.5rem;
    }

    .project-card:hover .project-image {
        transform: none;
    }

    #project-modal>div {
        width: 92% !important;
        margin: 2rem auto;
        padding: 0;
    }

    #project-modal .p-8 {
        padding: 1.5rem !important;
    }

    .social-btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 0.5rem;
    }

    #header .container {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding-top: 1rem;
        padding-bottom: 1rem;
        height: auto !important;
    }

    #header .text-3xl {
        width: auto !important;
        margin-bottom: 0 !important;
    }

    #header .flex.items-center.gap-4 {
        position: static !important;
    }

    nav {
        display: none !important;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(15, 23, 42, 0.95);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 49;
    }

    nav.is-active {
        display: flex !important;
        flex-direction: column;
        gap: 0.5rem !important;
        align-items: center;
    }

    .nav-link {
        font-size: 1rem !important;
        padding: 0.75rem 1.5rem !important;
        width: 100%;
        text-align: center;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    #sheet-content nav {
        display: flex !important;
        flex-direction: column !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 1.5rem !important;
        gap: 1rem !important;
    }

    #sheet-content nav button {
        display: block !important;
        width: 100% !important;
        text-align: left !important;
        color: #cbd5e1 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 1rem 0.5rem !important;
    }

    #sheet-content nav button:hover {
        color: #22d3ee !important;
        padding-left: 1rem !important;
    }

    #sheet-content nav button:last-child {
        border-bottom: none !important;
    }
}

@media (max-width: 380px) {
    html {
        font-size: 13px;
    }

    .glass-card h3 {
        font-size: 1.1rem;
    }
}

#tarik-ai-widget {
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    #tarik-ai-widget:not(.open) {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        right: 20px;
        bottom: 20px;
        overflow: hidden;
        border: none;
        background: linear-gradient(to right, var(--cyan-500), var(--blue-600));
    }

    #tarik-ai-widget:not(.open) #chat-header {
        padding: 0 !important;
        justify-content: center !important;
        height: 100% !important;
        background: transparent !important;
    }

    #tarik-ai-widget:not(.open) .font-bold,
    #tarik-ai-widget:not(.open) #close-btn {
        display: none !important;
    }

    #tarik-ai-widget:not(.open) .ri-robot-2-line {
        font-size: 1.75rem !important;
        margin: 0 !important;
    }
}

#tarik-ai-widget.open {
    height: 500px !important;
    border-radius: 1rem !important;
}

@media (max-width: 768px) {
    #tarik-ai-widget.open {
        width: calc(100% - 40px) !important;
        height: 70vh !important;
        right: 20px;
        bottom: 20px;
    }
}

@media (min-width: 769px) {
    #tarik-ai-widget:not(.open) {
        height: 64px !important;
        width: 320px !important;
    }
}

#chat-box {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-bottom: 20px;
}

#chat-box::-webkit-scrollbar {
    width: 6px;
}

#chat-box::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

#chat-box::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

.dark #chat-box::-webkit-scrollbar-thumb {
    background-color: #475569;
}

.message {
    animation: fadeIn 0.3s ease-out;
    line-height: 1.5;
    word-wrap: break-word;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MOBİL UYUMLULUK - GENEL DÜZELTMELER
   ============================================ */

/* Footer mobil */
footer .grid {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    footer .grid {
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
}

/* Mağaza sayfası ürün grid */
@media (max-width: 640px) {
    #mini-projects-grid,
    #services-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Destek sayfası form */
@media (max-width: 768px) {
    #tab-new-ticket .grid,
    #tab-new-ticket .grid.md\:grid-cols-2,
    #tab-new-ticket .grid.md\:grid-cols-3 {
        grid-template-columns: 1fr !important;
    }

    #tab-new-ticket .md\:col-span-2 {
        grid-column: span 1 !important;
    }
}

/* Sipariş sorgulama - küçük ekranlarda ortalama */
@media (max-width: 480px) {
    body.flex.items-center {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* Sepet modalı mobil */
@media (max-width: 640px) {
    #cart-modal > div,
    #track-modal > div {
        max-height: 95vh;
        border-radius: 1rem;
    }
}

/* Admin paneli destek tablosu */
@media (max-width: 768px) {
    #section-support .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }

    .tab-buttons-wrap {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Sözleşme sayfası içerik */
@media (max-width: 640px) {
    .sozlesme-content {
        padding: 1.5rem !important;
    }

    .sozlesme-content h2 {
        font-size: 1.25rem;
    }
}

/* Genel: taşma önleme */
* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
}

/* Mobilde büyük padding'leri küçült */
@media (max-width: 640px) {
    .pt-32 {
        padding-top: 5rem !important;
    }

    .p-8 {
        padding: 1.25rem !important;
    }

    .p-12 {
        padding: 1.5rem !important;
    }

    footer {
        padding-top: 2.5rem !important;
    }
}

/* Nav link overflow — desktop'ta sıkışmaması için */
@media (max-width: 1024px) and (min-width: 768px) {
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}