:root {
    --bg: #ffffff;
    --card: #ffffff;
    --primary: #1877f2;
    --primary-hover: #166fe5;
    --primary-soft: rgba(24, 119, 242, 0.1);
    --text: #1c1e21;
    --text-secondary: #65676b;
    --muted: #8a8d91;
    --border: #e4e6eb;
    --danger: #e41e3f;
    --success: #42b72a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
}

/* Question menu (three dots) */
.question-menu-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s ease;
    z-index: 10;
}

.question-menu-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.card {
    position: relative;
    overflow: visible;
}

/* Profile settings button and modal */
.profile-settings-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-settings-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.profile-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.profile-settings-modal.active {
    display: flex;
}

.profile-settings-card {
    background: var(--card);
    border-radius: 12px;
    padding: 8px;
    min-width: 250px;
    max-width: 300px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}

.profile-settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s ease;
    cursor: pointer;
}

.profile-settings-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.profile-settings-item svg {
    flex-shrink: 0;
}

.profile-settings-item-danger {
    color: var(--danger);
}

.profile-settings-item-danger:hover {
    background: rgba(228, 30, 63, 0.1);
    color: var(--danger);
}

/* Question menu modal */
.question-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.question-menu-card {
    background: var(--card);
    border-radius: 12px;
    padding: 24px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}

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

.question-menu-card h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.question-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.question-menu-actions button {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.question-menu-actions .btn-hide {
    background: var(--primary-soft);
    color: var(--primary);
}

.question-menu-actions .btn-hide:hover {
    background: var(--primary);
    color: white;
}

.question-menu-actions .btn-delete {
    background: rgba(228, 30, 63, 0.1);
    color: var(--danger);
}

.question-menu-actions .btn-delete:hover {
    background: var(--danger);
    color: white;
}

.question-menu-actions .btn-activate {
    background: var(--success);
    color: white;
}

.question-menu-actions .btn-activate:hover {
    background: #059669;
    color: white;
}

.question-menu-actions .btn-cancel {
    background: var(--border);
    color: var(--text);
}

.question-menu-actions .btn-cancel:hover {
    background: var(--muted);
    color: white;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 20px;
    }
}

header {
    position: sticky;
    top: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-weight: 700;
    font-size: 20px;
    color: var(--primary);
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo:hover {
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s ease;
}

.nav-links a .icon {
    font-size: 16px;
    line-height: 1;
}

.nav-links a:hover {
    background: var(--bg);
    text-decoration: none;
}

/* User Search Styles */
.user-search-container {
    position: relative;
}

#user-search-input:focus {
    border-color: var(--primary);
    outline: none;
}

#user-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

#user-search-results a:last-child {
    border-bottom: none;
}

@media (max-width: 767px) {
    .nav-links {
        display: none;
    }
    
    .user-search-container {
        display: none;
    }
    
    /* Mobile bottom navigation */
    body {
        padding-bottom: 70px;
    }
    
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--card);
        border-top: 1px solid var(--border);
        z-index: 1000;
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        padding: 8px 0;
        box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 8px 4px;
        text-decoration: none;
        color: var(--text-secondary);
        flex: 1;
        min-width: 0;
        transition: all 0.2s ease;
        position: relative;
        -webkit-tap-highlight-color: transparent;
        border-radius: 8px;
        margin: 0 2px;
    }
    
    .mobile-nav-item:active {
        background: var(--primary-soft);
    }
    
    .mobile-nav-item.active {
        color: var(--primary);
    }
    
    
    .mobile-nav-item .label {
        font-size: 10px;
        font-weight: 500;
        line-height: 1.2;
        display: block;
        text-align: center;
        white-space: nowrap;
    }
    
    .mobile-nav-item.ask {
        color: var(--primary);
    }
    
    .mobile-nav-item.ask.active {
        color: var(--primary);
    }
    
    .mobile-nav-item.ask .icon {
        font-size: 28px;
        margin-bottom: 2px;
    }
    
    .mobile-nav-item.ask .icon svg {
        stroke-width: 2.5;
    }
}

@media (min-width: 768px) {
    .mobile-nav {
        display: none;
    }
}

.btn {
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 4px rgba(24, 119, 242, 0.2);
}

.btn-primary:hover {
    background: var(--primary-hover);
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(24, 119, 242, 0.3);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    font-weight: 500;
}

.btn-ghost:hover {
    background: var(--primary-soft);
    color: var(--primary);
    transform: translateY(-1px);
}

.btn:active { 
    transform: scale(0.98); 
}

.btn.sm { 
    padding: 6px 12px; 
    font-size: 14px;
    font-weight: 500;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow);
}

.question-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px;
    line-height: 1.5;
    color: var(--text);
}

.meta {
    display: flex;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    align-items: center;
    font-weight: 400;
}

.meta a {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.meta a:hover {
    text-decoration: underline;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.option-btn {
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    padding: 14px 18px;
    border-radius: 10px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
}

.option-btn:hover { 
    border-color: var(--primary);
    background: var(--primary-soft);
    transform: translateY(-1px);
}

.option-btn .tag {
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
}

.stat-row {
    display: flex;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

input, textarea, select {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 15px;
    width: 100%;
    background: var(--card);
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

input::placeholder, textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

textarea { 
    resize: vertical; 
    min-height: 100px;
    line-height: 1.5;
}

.form-status {
    font-size: 14px;
    min-height: 20px;
    font-weight: 500;
}

/* Success Popup */
.success-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.success-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.success-popup-content {
    background: linear-gradient(135deg, #42b72a 0%, #36a420 100%);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(66, 183, 42, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
}

.success-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}

.success-message {
    font-size: 15px;
    font-weight: 600;
}

/* Page Loading Overlay */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.page-loading-overlay.show {
    opacity: 1;
    pointer-events: all;
}

/* Loading Spinner */
.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.grid {
    display: grid;
    gap: 12px;
}

@media (min-width: 720px) {
    .grid.two {
        grid-template-columns: 1fr 1fr;
    }
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 16px;
    font-weight: 500;
    font-size: 12px;
}

.section-title {
    margin: 0 0 16px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
}

.profile-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 32px;
    color: var(--primary);
    flex-shrink: 0;
    border: 2px solid var(--border);
}

.tag {
    color: var(--text-secondary);
    font-size: 13px;
}

.empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px 16px;
    font-size: 15px;
    background: var(--card);
}

.nav-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
    transition: background 0.2s ease;
}

.nav-links a .icon {
    font-size: 16px;
    line-height: 1;
}

.nav-links a:hover {
    background: var(--bg);
    text-decoration: none;
}

.list-section {
    display: grid;
    gap: 12px;
}

.option-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress {
    position: relative;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: var(--border);
    overflow: hidden;
    margin-top: 6px;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--primary);
}

.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 28px;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
    z-index: 90;
    transition: all 0.2s ease;
}

.fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    background: var(--primary-hover);
}

@media (max-width: 767px) {
    .fab {
        display: none;
    }
}

@media (min-width: 768px) {
    .fab {
        bottom: 24px;
    }
}

.disclaimer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    padding: 24px 16px;
    max-width: 600px;
    margin: 0 auto;
}

.share-menu {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.share-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.share-btn:hover {
    background: var(--primary-soft);
}

.question-actions {
    position: relative;
    display: inline-block;
}

.actions-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    min-width: 120px;
    display: none;
    z-index: 10;
}

.actions-menu.show {
    display: block;
}

.action-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text);
}

.action-item:last-child {
    border-bottom: none;
}

.action-item:hover {
    background: var(--primary-soft);
}

/* Enhanced question card body text */
.card > div[style*="margin-bottom"] {
    color: var(--text) !important;
    font-size: 15px;
    line-height: 1.5;
}

/* Improved action button icons */
.stat-row .btn-ghost::before {
    font-weight: 400;
    font-size: 16px;
}

.stat-row .btn-ghost[data-like]::before {
    content: "♥ ";
}

.stat-row .btn-ghost[data-save]::before {
    content: "🔖 ";
}

.stat-row .btn-ghost[data-report]::before {
    content: "⚠ ";
}

.stat-row .btn-ghost[data-share]::before {
    content: "↗ ";
}

/* Better spacing for stat counts */
.stat-row > span {
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Profile improvements */
.profile-header > div {
    flex: 1;
}

.profile-header .meta {
    margin-top: 8px;
    margin-bottom: 12px;
}

.profile-header .meta > span {
    padding: 4px 10px;
    background: var(--bg);
    border-radius: 4px;
    font-weight: 500;
}

/* Better card separation */
main .card:first-of-type {
    margin-top: 16px;
}

/* Improved link styling */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Better progress bar */
.option-result {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    margin-bottom: 8px;
}

.option-result > div:first-child {
    flex: 1;
}

.option-result .tag {
    font-weight: 600;
    color: var(--primary);
    margin-left: 12px;
}

.progress {
    position: relative;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
    margin-top: 8px;
}

.progress span {
    display: block;
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Better disclaimer */
.disclaimer {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 32px 16px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.disclaimer a {
    font-weight: 600;
}

/* Responsive improvements */
@media (max-width: 640px) {
    .section-title {
        font-size: 18px;
    }
    
    .question-title {
        font-size: 16px;
    }
    
    .avatar {
        width: 64px;
        height: 64px;
        font-size: 24px;
    }
    
    .profile-header {
        gap: 12px;
    }
}

/* Loading and empty states */
.card.empty {
    background: var(--card);
    border-style: dashed;
    border-color: var(--border);
}

/* Better form button */
form .btn {
    margin-top: 8px;
}

/* Category page improvements */
.card a[href*="category.php"] {
    display: block;
}

.card a[href*="category.php"]:hover {
    opacity: 0.9;
}

/* Button icon spacing */
.btn-ghost[data-like],
.btn-ghost[data-save],
.btn-ghost[data-report],
.btn-ghost[data-share] {
    font-size: 14px;
}

/* Smooth transitions for all interactive elements */
button, a, .card, input, textarea, select {
    transition: all 0.2s ease;
}

/* Better checkbox styling */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

/* Better select dropdown */
select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Loading state for cards */
.card:empty::after {
    content: "Yükleniyor...";
    color: var(--text-secondary);
    text-align: center;
    display: block;
}

/* Better list spacing */
main > .card:first-child {
    margin-top: 0;
}

main .section-title:first-child {
    margin-top: 16px;
}

/* Improved meta spacing in profile */
.profile-header .section-title {
    margin-bottom: 4px;
}

/* Better option button states */
.option-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Hover effects for all cards */
.card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* Better focus states */
button:focus-visible, 
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Improved button group */
.stat-row .btn-ghost {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

/* Better form layout */
form > label {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

/* Improved grid for responsive */
@media (max-width: 640px) {
    .grid.two {
        grid-template-columns: 1fr;
    }
}

/* Better spacing for main sections */
main section {
    margin-bottom: 24px;
}

/* Improved header for hero section */
main .card:first-of-type h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

/* Mobile navigation improvements */
@media (max-width: 640px) {
    .nav {
        padding: 10px 12px;
    }
    
    .logo {
        font-size: 18px;
    }
}

/* Better card content spacing */
.card > p:first-of-type {
    margin-top: 0;
}

.card > p:last-child {
    margin-bottom: 0;
}

/* Profile stats styling */
.profile-header .meta span {
    white-space: nowrap;
}

/* Ensure buttons don't wrap text awkwardly */
.btn {
    white-space: nowrap;
}

/* Better form button width on mobile */
@media (max-width: 640px) {
    form .btn-primary {
        width: 100%;
    }
}

/* Improved empty state */
.empty {
    background: var(--card);
}

/* Better visual hierarchy for question text */
.card .question-title + div {
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

/* Improved hover state for navigation links */
.nav-links a.btn-primary:hover {
    background: var(--primary-hover);
}

/* Better spacing for form elements */
form > * + * {
    margin-top: 0;
}

/* Enhanced pill readability */
.meta .pill {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Better card padding on mobile */
@media (max-width: 640px) {
    .card {
        padding: 14px;
    }
}

/* Improved focus ring for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Better text selection color */
::selection {
    background: var(--primary-soft);
    color: var(--text);
}

