:root {
    --primary: #724e8e;;
    --primary-dark: #42324f;
    --accent: #D4A373;
    --bg: #F9FCF8;
    --card: #ffffff;
    --text: #333;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --radius: 16px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Font */
@font-face {
    font-family: 'UKIJTuz';
    src: url('http://chaychat.com/fonts/UKIJTuz.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* { font-family: UKIJTuz, Tahoma, sans-serif; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { margin: 0; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); padding-bottom: 80px; }
.container { max-width: 600px; margin: 0 auto; padding: 15px; }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.btn { background: var(--primary); color: white; border: none; padding: 12px 20px; border-radius: 12px; font-weight: 600; cursor: pointer; width: 100%; transition: 0.2s; font-size: 1rem; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-danger { background: #ef4444; }
.btn-follow { background: var(--primary); color: white; }
.btn-following { background: transparent; border: 2px solid var(--border); color: var(--text); }
.input-field { width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 12px; font-size: 1rem; margin-bottom: 15px; transition: 0.2s; outline: none; }
.input-field:focus { border-color: var(--primary); }

.auth-tabs { display: flex; justify-content: center; margin-bottom: 20px; border-bottom: 1px solid #ddd; }
.auth-tab { padding: 10px 20px; cursor: pointer; color: #888; border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--primary); border-bottom: 2px solid var(--primary); font-weight: bold; }
.google-btn { width: 100%; margin-top: 15px; }

.bottom-nav { position: fixed; bottom: 0; width: 100%; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 12px 0; z-index: 1000; }
.nav-item { color: var(--text-light); font-size: 1.4rem; position: relative; padding: 5px 15px; transition: 0.3s; border-radius: 12px; }
.nav-item.active { color: var(--primary); background: #e0e7ff; }

.app-header { display: flex; justify-content: space-between; align-items: center; padding: 15px 20px; background: white; position: sticky; top: 0; z-index: 900; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.logo { font-weight: 800; font-size: 1.5rem; background: linear-gradient(45deg, var(--primary), var(--accent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.avatar { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; border: 2px solid white; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.post-content { font-size: 1rem; line-height: 1.5; margin-bottom: 12px; word-break: break-word; }
.post-media img, .post-media video { width: 100%; border-radius: 12px; margin-top: 8px; max-height: 400px; object-fit: cover; }
.post-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.action-btn { flex: 1; text-align: center; color: var(--text-light); font-weight: 500; cursor: pointer; background:none; border:none; font-family:'Inter'; font-size: 0.9rem;}
.action-btn:hover { color: var(--primary); }
.action-btn.liked { color: var(--accent); }

.editor-toolbar { display: flex; gap: 5px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 10px; padding-bottom: 8px; }
.editor-btn { padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: #f9fafb; cursor: pointer; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; min-width: 35px; height: 35px; position: relative; color: #444;}
.editor-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.editor-btn.recording { background: #ef4444; color: white; border-color: #ef4444; animation: pulse 1.5s infinite; }
.color-picker-wrapper { overflow: hidden; width: 35px; height: 35px; position: relative; padding: 0;}
.color-picker-wrapper input[type="color"] { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; cursor: pointer; opacity: 0; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

.editor-content { min-height: 80px; max-height: 200px; overflow-y: auto; padding: 10px; outline: none; background: #fafafa; border-radius: 8px; border: 1px solid var(--border); }
.editor-content sup { vertical-align: super; font-size: smaller; }
.editor-content sub { vertical-align: sub; font-size: smaller; }

.mini-toolbar { display:flex; gap:5px; padding: 5px 0; flex-wrap: wrap;}
.rich-input-container { display: flex; flex-direction:column; gap: 5px; border: 2px solid var(--border); border-radius: 12px; padding: 10px; background: white; }
.rich-input-field { flex: 1; padding: 8px; min-height: 40px; max-height: 120px; overflow-y: auto; outline: none; font-size: 0.95rem; background: #fafafa; border-radius:8px; }

.modal-overlay {position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); z-index: 2000; display: none; align-items: center; justify-content: center; padding: 15px;}
.modal-content { background: var(--card); border-radius: var(--radius); padding: 20px; max-width: 90%; width: 500px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); position: relative; max-height: 80vh; overflow-y: auto;}

.modal-section-title { font-size:0.9rem; color: var(--text-light); margin: 10px 0 5px; font-weight:600; border-bottom:1px solid #eee; padding-bottom:5px; }
.math-tools-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 15px; }
.math-symbols-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.modal-btn { padding: 10px; background: #f0f2f5; text-align: center; border-radius: 8px; cursor: pointer; font-size: 1.2rem; transition: 0.2s; }
.modal-btn:hover { background: var(--primary); color: white; }

.emoji-tabs { display: flex; overflow-x: auto; gap: 5px; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid #eee; }
.emoji-tab { padding: 5px 10px; cursor: pointer; font-size: 1.2rem; border-radius: 8px; white-space: nowrap; }
.emoji-tab:hover, .emoji-tab.active { background: #f0f2f5; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; height: 250px; overflow-y: auto; }
.emoji-btn { font-size: 1.5rem; cursor: pointer; padding: 5px; text-align: center; border-radius: 5px; }
.emoji-btn:hover { background: #f0f2f5; }

.video-container { height: calc(100vh - 140px); overflow-y: scroll; scroll-snap-type: y mandatory; background: transparent; }
.video-slide { height: 100%; scroll-snap-align: start; position: relative; display: flex; align-items: center; justify-content: center; background: #000; }
.video-slide video { width: 100%; height: 100%; object-fit: contain; }
.video-user-info { position: absolute; left: 15px; bottom: 100px; color: white; z-index: 10; width: 80%; }
.video-interactions { position: absolute; right: 10px; bottom: 90px; color: white; z-index: 100; display: flex; flex-direction: column; gap: 15px; align-items: center; }

/* --- VIDEO YORUM MODALI (Bottom Sheet Design) --- */

.video-comments {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 75vh; /* Ekranın %75'ini kaplasın */
    background: rgba(20, 20, 20, 0.5); 
    backdrop-filter: blur(10px); 
    color: #fff;
    z-index: 10000;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5);
    display: none; /* JS ile kontrol edilir */
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* JS inline display:block verdiğinde flex yapısını korumak için */
.video-comments[style*="display: block"], 
.video-comments[style*="display:block"] {
    display: flex !important;
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Üst kısımdaki tutamaç (Handle Bar) */
.comment-close {
    width: 100%;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.comment-close::after {
    content: '';
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

/* İçerik Alanı */
.comments-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px 80px 15px; /* Form için alttan boşluk bırak */
    position: relative;
    -webkit-overflow-scrolling: touch;
}

/* Kapatma butonu (X) - İsteğe bağlı gizlenebilir, handle var */
.comment-x-btn {
    position: absolute;
    top: 5px;
    right: 15px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.2rem;
    z-index: 10;
    cursor: pointer;
}
.comment-x-btn:hover { color: #fff; }

/* Tekil Yorum */
.single-comment {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    line-height: 1.4;
}

.single-comment b {
    color: #fff;
    margin-right: 5px;
    font-weight: 600;
}

/* Yorum Formu - En alta sabitlenmiş */
.comment-form {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: rgba(30, 30, 30, 0.1); /* Formun arkası düz renk */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

.comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 15px;
    border-radius: 25px;
    outline: none;
    font-size: 0.9rem;
    transition: 0.3s;
}

.comment-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
}

.comment-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.send-comment-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
    flex-shrink: 0;
}

.send-comment-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.market-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.product-card img, .product-card video { width: 100%; height: 150px; object-fit: cover; border-radius: 12px; }

#live-recording-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 2500; display: none; flex-direction: column; align-items: center; justify-content: center; }
#live-video-feed { width: 100%; height: 100%; object-fit: cover; opacity: 0.6; }
.recording-controls { position: absolute; bottom: 50px; left: 0; width: 100%; display: flex; justify-content: center; gap: 20px; z-index: 2600; }
.rec-indicator { position: absolute; top: 20px; right: 20px; display: flex; align-items: center; gap: 8px; background: rgba(255,0,0,0.7); color: white; padding: 5px 12px; border-radius: 20px; font-weight: bold; animation: pulse 1s infinite; }

.preview-container { display:flex; gap:5px; flex-wrap:wrap; margin-top:5px; }
.preview-item { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid #ddd; }

.comment-like-btn { cursor: pointer; font-size: 0.85rem; margin-left: 10px; color: #888; background:none; border:none; }
.comment-like-btn:hover { color: var(--accent); }
.comment-like-btn.liked { color: var(--accent); }

.fade-in { animation: fadeIn 0.4s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.share-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 20px; }
.share-item { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; padding: 10px; border-radius: 12px; transition: 0.2s; }
.share-item:hover { background: #f0f2f5; }
.share-icon { width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: white; font-size: 1.5rem; }