:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --success-color: #10b981;
    --success-hover: #059669;
    --error-color: #ef4444;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-sub: #6b7280;
    --border-radius: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    text-align: center;
    transition: transform 0.3s ease;
}

h1 { font-size: 1.8rem; margin-bottom: 0.5rem; color: #111827; }
p.desc { color: var(--text-sub); margin-bottom: 2rem; line-height: 1.5; }

.input-group { margin-bottom: 1.5rem; text-align: left; }
.input-group label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: #374151; }

input[type="text"], input[type="url"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
    outline: none;
}
input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }

/* Buton Stilleri ve Animasyonları */
.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-tap-highlight-color: transparent; /* Mobil dokunma efekti */
}
.btn:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }

.btn-download { 
    background-color: var(--success-color); 
    display: none; 
    margin-top: 15px; 
    opacity: 0;
    animation: fadeIn 0.5s forwards;
}
.btn-download:hover { background-color: var(--success-hover); }

/* QR Container */
#qrcode-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: var(--border-radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s;
}
#qrcode-container.active { border-color: var(--primary-color); border-style: solid; }

#placeholder-text { color:#9ca3af; font-size: 0.9rem; transition: opacity 0.3s; }

/* QR Kodun Kendisi için Animasyon */
#qrcode img, #qrcode canvas {
    max-width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Toast Bildirimleri */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Tıklamaları engelleme */
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-size: 0.95rem;
    min-width: 250px;
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: auto; /* Toast'a tıklanabilir olsun */
}

.toast.show { opacity: 1; transform: translateX(0); }
.toast.error { background-color: var(--error-color); }
.toast.success { background-color: var(--success-color); }
.toast.info { background-color: var(--primary-color); }

/* Yükleniyor Animasyonu (Buton içi) */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid #ffffff;
    border-bottom-color: transparent;
    border-radius: 50%;
    animation: rotation 1s linear infinite;
    margin-left: 10px;
}
.btn.loading .btn-text { opacity: 0.8; }
.btn.loading .loader { display: inline-block; }
.btn.loading { pointer-events: none; opacity: 0.8; }

/* --- MOBİL UYUMLULUK (Responsive) --- */
@media (max-width: 600px) {
    body {
        padding: 10px; /* Mobilde kenar boşluğunu azalt */
        justify-content: flex-start; /* Mobilde üstten başlasın */
        padding-top: 40px;
    }
    
    .container {
        padding: 1.5rem; /* Container iç boşluğunu azalt */
        width: 100%; /* Tam genişlik */
    }

    h1 { font-size: 1.5rem; }
    p.desc { margin-bottom: 1.5rem; font-size: 0.95rem; }
    
    #qrcode-container {
        min-height: 200px; /* Mobilde yüksekliği biraz azalt */
    }
    
    #toast-container {
        right: 10px;
        left: 10px; /* Mobilde toast ortalı/tam genişlik */
        top: 10px;
        align-items: center;
    }
    
    .toast {
        min-width: unset;
        width: 100%; /* Mobilde tam genişlik toast */
        justify-content: center;
    }
}

/* Keyframes */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}