/*
 * Duman Ailesi Oyun Platformu - Ortak Stiller
 * Bu dosya tüm oyunlarda kullanılacak standart UI bileşenlerini içerir.
 * Versiyon: 1.0
 */

/* ===== ORTAK DEĞİŞKENLER ===== */
:root {
    --portal-bg: #0f172a;
    --portal-card: rgba(30, 41, 59, 0.85);
    --portal-accent: #6366f1;
    --portal-accent-hover: #8b5cf6;
    --portal-success: #00ff88;
    --portal-text: #f8fafc;
    --portal-text-dim: #94a3b8;
    --portal-border: rgba(255, 255, 255, 0.1);
    --portal-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --portal-radius: 20px;
    --portal-radius-sm: 12px;
}

/* ===== ORTAK SETUP/LOGIN EKRANI ===== */
.portal-setup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--portal-bg);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.15) 0%, transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.portal-setup-card {
    background: var(--portal-card);
    backdrop-filter: blur(20px);
    border-radius: var(--portal-radius);
    border: 1px solid var(--portal-border);
    box-shadow: var(--portal-shadow);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    animation: portalSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes portalSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== LOGO VE BAŞLIK ===== */
.portal-game-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--portal-accent), var(--portal-accent-hover));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 20px auto;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    transform: rotate(-5deg);
}

.portal-game-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--portal-text);
    margin: 0 0 8px 0;
    letter-spacing: -1px;
}

.portal-game-title span {
    background: linear-gradient(135deg, #818cf8, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.portal-subtitle {
    color: var(--portal-text-dim);
    font-size: 0.95rem;
    margin: 0 0 30px 0;
}

/* ===== FORM ALANLARI ===== */
.portal-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.portal-input-group {
    position: relative;
    width: 100%;
}

.portal-input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--portal-accent);
    opacity: 0.7;
    font-size: 0.9rem;
}

.portal-input {
    width: 100%;
    padding: 14px 14px 14px 45px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    color: var(--portal-text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s;
}

.portal-input:focus {
    border-color: var(--portal-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.portal-input::placeholder {
    color: var(--portal-text-dim);
    opacity: 0.7;
}

/* ===== SELECT (DROPDOWN) ===== */
.portal-select {
    width: 100%;
    padding: 14px 14px 14px 45px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius-sm);
    color: var(--portal-text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    transition: all 0.3s;
}

.portal-select:focus {
    border-color: var(--portal-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.portal-select option {
    background: #1e293b;
    color: var(--portal-text);
}

/* ===== BUTONLAR ===== */
.portal-btn {
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: var(--portal-radius-sm);
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.portal-btn-primary {
    background: linear-gradient(135deg, var(--portal-accent), var(--portal-accent-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.portal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    background: linear-gradient(135deg, var(--portal-success), #00cc6a);
}

.portal-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--portal-text);
    border: 1px solid var(--portal-border);
}

.portal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.portal-btn-ghost {
    background: transparent;
    color: var(--portal-text-dim);
    padding: 12px 20px;
    font-size: 0.9rem;
}

.portal-btn-ghost:hover {
    color: var(--portal-text);
}

/* ===== BUTON GRUPLARI ===== */
.portal-btn-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.portal-btn-row {
    display: flex;
    gap: 12px;
}

.portal-btn-row .portal-btn {
    flex: 1;
}

/* ===== AYIRICI ===== */
.portal-divider {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 20px 0;
    color: var(--portal-text-dim);
    font-size: 0.8rem;
}

.portal-divider::before,
.portal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--portal-border);
}

/* ===== TOGGLE SWITCH ===== */
.portal-toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--portal-radius-sm);
    border: 1px solid var(--portal-border);
}

.portal-toggle-label {
    color: var(--portal-text);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-toggle-label i {
    color: var(--portal-accent);
    opacity: 0.8;
}

.portal-toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.portal-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.portal-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    transition: 0.3s;
}

.portal-toggle-slider::before {
    position: absolute;
    content: '';
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.portal-toggle input:checked+.portal-toggle-slider {
    background: var(--portal-accent);
}

.portal-toggle input:checked+.portal-toggle-slider::before {
    transform: translateX(24px);
}

/* ===== ANA SAYFA LİNKİ ===== */
.portal-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--portal-text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 12px;
    margin-top: 15px;
    border-radius: var(--portal-radius-sm);
    transition: all 0.3s;
}

.portal-home-link:hover {
    color: var(--portal-text);
    background: rgba(255, 255, 255, 0.05);
}

/* ===== AYARLAR MODAL ===== */
.portal-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.portal-settings-modal.active {
    display: flex;
}

.portal-settings-card {
    background: var(--portal-card);
    backdrop-filter: blur(20px);
    border-radius: var(--portal-radius);
    border: 1px solid var(--portal-border);
    padding: 30px;
    width: 90%;
    max-width: 360px;
    animation: portalSlideUp 0.3s ease;
}

.portal-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.portal-settings-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--portal-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.portal-settings-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--portal-text-dim);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.portal-settings-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--portal-text);
}

.portal-settings-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== SEGMENTED CONTROL ===== */
.portal-segment-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-segment-label {
    font-size: 0.85rem;
    color: var(--portal-text-dim);
    margin-left: 5px;
}

.portal-segments {
    display: flex;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--portal-radius-sm);
    padding: 4px;
    border: 1px solid var(--portal-border);
}

.portal-segment {
    flex: 1;
    padding: 10px;
    text-align: center;
    color: var(--portal-text-dim);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    border: none;
    background: none;
    font-family: inherit;
}

.portal-segment:hover {
    color: var(--portal-text);
}

.portal-segment.active,
.portal-segment input:checked+label {
    background: var(--portal-accent);
    color: white;
}

/* ===== MOBİL UYUMLULUK ===== */
@media (max-width: 480px) {
    .portal-setup-card {
        padding: 25px 20px;
        max-width: 100%;
    }

    .portal-game-icon {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
    }

    .portal-game-title {
        font-size: 1.6rem;
    }

    .portal-subtitle {
        font-size: 0.85rem;
        margin-bottom: 20px;
    }

    .portal-input,
    .portal-select {
        padding: 12px 12px 12px 40px;
        font-size: 0.95rem;
    }

    .portal-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .portal-btn-row {
        flex-direction: column;
    }

    .portal-settings-card {
        padding: 20px;
    }
}

/* ===== YÜKLENİYOR ANİMASYONU ===== */
.portal-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: portalSpin 0.8s linear infinite;
}

@keyframes portalSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== BADGE ===== */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(99, 102, 241, 0.2);
    color: var(--portal-accent);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
}

.portal-badge-success {
    background: rgba(0, 255, 136, 0.15);
    color: var(--portal-success);
}

/* ===== DURUM MESAJLARI ===== */
.portal-status {
    padding: 10px 15px;
    border-radius: var(--portal-radius-sm);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.portal-status-info {
    background: rgba(99, 102, 241, 0.1);
    color: var(--portal-accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.portal-status-success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--portal-success);
    border: 1px solid rgba(0, 255, 136, 0.2);
}

.portal-status-error {
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.2);
}