/* ============================================================
   COMMON.CSS - QR Menu Ortak Stiller
   ============================================================ */

/* CSS Variables - Varsayılan renkler (DB'den override edilecek) */
:root {
    --primary: #2c3e50;
    --accent: #e74c3c;
    --bg: #f8f9fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #777777;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden; /* prevent fixed-overlay offset caused by content overflow */
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100%;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    opacity: 0.8;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: var(--font);
    transition: var(--transition);
}

input, select, textarea {
    font-family: var(--font);
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.9rem;
    outline: none;
    transition: var(--transition);
    width: 100%;
    background: #fff;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.google-auth-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.96));
}

.google-auth-hint {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-light);
    line-height: 1.5;
}

.google-auth-button-slot {
    min-height: 40px;
}

.auth-action-row {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-top: 6px;
}

.auth-action-row .login-submit-btn {
    flex: 1 1 auto;
    width: auto;
    margin-top: 0;
}

.google-auth-card-inline {
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
}

.google-auth-card-inline .google-auth-button-slot {
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.google-auth-verified {
    display: none;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
}

.google-auth-avatar {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    overflow: hidden;
    background: #dbeafe;
    color: #1d4ed8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.google-auth-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.google-auth-user {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.google-auth-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.google-auth-email {
    font-size: 0.8rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.google-auth-signout {
    margin-left: auto;
    background: transparent;
    border: 1px solid rgba(29, 78, 216, 0.16);
    color: #1d4ed8;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.78rem;
    font-weight: 700;
}

.google-auth-signout:hover {
    background: rgba(29, 78, 216, 0.08);
}

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s;
}
.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
    text-align: center;
}
.error-container .error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.error-container h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}
.error-container p {
    color: var(--text-light);
}

/* Language Selector */
.lang-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 24px;
    padding: 5px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #fff;
    user-select: none;
}
.lang-selector .lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}
.lang-selector .lang-arrow {
    font-size: 0.6rem;
    transition: transform 0.2s;
}
.lang-selector.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    min-width: 140px;
    z-index: 100;
    max-height: 260px;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: none;
}
.lang-dropdown::-webkit-scrollbar { width: 4px; }
.lang-dropdown::-webkit-scrollbar-track { background: transparent; }
.lang-dropdown::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.lang-dropdown.open {
    display: block;
    animation: fadeSlideDown 0.2s ease;
}

.lang-dropdown .lang-option {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}
.lang-dropdown .lang-option:hover {
    background: var(--bg);
}
.lang-dropdown .lang-option.active {
    background: var(--accent);
    color: #fff;
}

/* Light version for pages with light backgrounds */
.lang-selector-light {
    background: rgba(0,0,0,0.05);
    border-color: var(--border);
    color: var(--text);
}

@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Social Media Icons */
.social-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 1.2rem;
    line-height: 0;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.2);
}
.social-link svg {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    overflow: visible;
}
.social-link:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.3);
    opacity: 1;
}

/* Social media colors */
.social-link[data-platform="facebook"] { background: #1877f2; border-color: #1877f2; }
.social-link[data-platform="instagram"] { background: #e4405f; border-color: #e4405f; }
.social-link[data-platform="twitter"] { background: #1da1f2; border-color: #1da1f2; }
.social-link[data-platform="whatsapp"] { background: #25d366; border-color: #25d366; }
.social-link[data-platform="telegram"] { background: #0088cc; border-color: #0088cc; }
.social-link[data-platform="youtube"] { background: #ff0000; border-color: #ff0000; }
.social-link[data-platform="tiktok"] { background: #000000; border-color: #333; }

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    animation: fadeSlideDown 0.3s ease;
    max-width: 360px;
    border-left: 4px solid var(--accent);
}
.toast.success { border-left-color: #27ae60; }
.toast.error { border-left-color: #e74c3c; }
.toast.info { border-left-color: #3498db; }
.toast.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(30px); }
}

/* Utility */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none !important; }

/* Button Base */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.65rem 1.3rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}
.btn-secondary {
    background: var(--primary);
    color: #fff;
}
.btn-secondary:hover {
    filter: brightness(1.15);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
}
.btn-outline:hover {
    background: var(--accent);
    color: #fff;
}
.btn-danger {
    background: #e74c3c;
    color: #fff;
}
.btn-danger:hover {
    background: #c0392b;
}
.btn-success {
    background: #16a34a;
    color: #fff;
}
.btn-success:hover {
    background: #15803d;
    filter: brightness(1.08);
    transform: translateY(-1px);
}
.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}
.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1.1rem;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        left: 10px;
        right: 10px;
        top: 10px;
        max-width: calc(100vw - 20px);
    }
    .toast {
        max-width: 100%;
        font-size: 0.85rem;
        padding: 10px 14px;
    }
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    html { font-size: 15px; }
    .btn {
        min-height: 44px;
        padding: 0.6rem 1rem;
    }
    .btn-sm {
        min-height: 36px;
        padding: 0.4rem 0.75rem;
    }
    .btn-lg {
        min-height: 48px;
    }
}

/* reCAPTCHA v3 badge — yandan açılır */
.grecaptcha-badge {
    visibility: visible !important;
    opacity: 0.5 !important;
    transform: scale(0.95) !important;
    transform-origin: right bottom !important;
    box-shadow: none !important;
}
.grecaptcha-badge:hover {
    opacity: 1 !important;
}
