/* login.css - Stok Takip Login Sayfası */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1d29 0%, #13151f 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sayfa Başlığı */
.page-header {
    padding: 40px 20px;
    text-align: center;
    /* Notch/safe area desteği — 40px + notch yüksekliği */
    padding-top: calc(40px + constant(safe-area-inset-top));
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #e4e6eb;
    letter-spacing: -0.5px;
}

/* Ana İçerik */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* Kullanıcı Grid */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 180px);
    gap: 20px;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
}

/* Kullanıcı Kutusu */
.user-box {
    width: 180px;
    height: 180px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(102, 126, 234, 0.3);
    position: relative;
}

.user-box:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.4);
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
}

/* + Kutusu */
.add-user-box {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
}

.plus-icon {
    font-size: 5rem;
    color: #667eea;
    font-weight: 300;
    line-height: 1;
    user-select: none;
    text-shadow: 0 0 30px rgba(102, 126, 234, 0.5);
}

/* Kayıtlı Kullanıcı Kutusu */
.saved-user-box {
    padding: 20px;
}

.saved-user-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 2rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    margin-bottom: 12px;
}

.saved-user-name {
    font-weight: 600;
    color: #e4e6eb;
    font-size: 0.95rem;
    text-align: center;
    margin-bottom: 8px;
}

.saved-user-role {
    font-size: 0.75rem;
    color: #b0b3b8;
    text-align: center;
}

/* Kullanıcı Aksiyonları */
.user-box-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.user-box:hover .user-box-actions {
    opacity: 1;
}

.user-box-actions button {
    background: rgba(102, 126, 234, 0.3);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.user-box-actions button:hover {
    background: rgba(102, 126, 234, 0.5);
}

.user-box-actions .btn-delete:hover {
    background: rgba(239, 68, 68, 0.5);
}

/* Giriş Paneli */
.login-panel {
    display: none;
    background: rgba(35, 39, 53, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    width: 420px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(102, 126, 234, 0.3);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 999;
}

.overlay.active {
    display: block;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #b0b3b8;
}

.close-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.login-panel h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #e4e6eb;
    margin-bottom: 30px;
}

/* Input Alanları */
.input-wrapper {
    margin-bottom: 16px;
}

.input-wrapper input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    font-size: 1rem;
    color: #e4e6eb;
    background: rgba(102, 126, 234, 0.05);
    transition: all 0.2s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-wrapper input::placeholder {
    color: #b0b3b8;
}

/* Giriş Butonu */
.btn-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Test Bilgisi */
.test-info {
    margin-top: 20px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(102, 126, 234, 0.2);
}

.test-info small {
    color: #b0b3b8;
    font-size: 0.85rem;
}

/* Alert Box */
.alert-box {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    animation: slideDown 0.3s ease;
    border-left: 4px solid;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ff6b6b;
    border-left-color: #ef4444;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    color: #86efac;
    border-left-color: #22c55e;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-left-color: #3b82f6;
}

/* ============================================
   MODAL STYLES
   ============================================ */

/* Confirm Modal (Silme Onayı) */
.confirm-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(35, 39, 53, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    z-index: 2000;
    animation: modalPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.confirm-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(3px);
    z-index: 1999;
}

.confirm-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(220, 38, 38, 0.2) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ff6b6b;
    font-size: 1.8rem;
}

.confirm-modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #e4e6eb;
    text-align: center;
    margin-bottom: 12px;
}

.confirm-modal-message {
    color: #b0b3b8;
    text-align: center;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.confirm-modal-username {
    background: rgba(102, 126, 234, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 25px;
    color: #667eea;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
}

.confirm-modal-buttons button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-confirm-cancel {
    background: rgba(102, 126, 234, 0.1);
    color: #b0b3b8;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.btn-confirm-cancel:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #e4e6eb;
}

.btn-confirm-delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-confirm-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-confirm-delete:active {
    transform: translateY(0);
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top, 0px));
    right: 20px;
    background: rgba(35, 39, 53, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(102, 126, 234, 0.3);
    z-index: 3000;
    animation: toastSlideIn 0.4s ease;
    min-width: 300px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast-notification.toast-out {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-success .toast-icon {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.2);
    color: #ff6b6b;
}

.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: #e4e6eb;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.toast-message {
    color: #b0b3b8;
    font-size: 0.85rem;
}

/* Edit User Modal */
.edit-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(35, 39, 53, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 30px;
    width: 500px;
    max-width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(102, 126, 234, 0.3);
    z-index: 2000;
    animation: modalPop 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Scrollbar for Edit Modal */
.edit-modal::-webkit-scrollbar {
    width: 8px;
}

.edit-modal::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.edit-modal::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.edit-modal::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* Edit Modal - Profil Kartı */
.edit-profile-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.edit-profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.edit-profile-info {
    flex: 1;
}

.edit-profile-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    color: #e4e6eb;
    margin: 0 0 5px 0;
}

.edit-profile-info p {
    font-size: 0.9rem;
    color: #b0b3b8;
    margin: 0;
}

/* Edit Section */
.edit-section {
    margin-bottom: 20px;
}

.edit-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #b0b3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Renk Seçimi - Büyük Alan */
.edit-color-section {
    margin-bottom: 20px;
}

.color-picker-large {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    background: rgba(102, 126, 234, 0.05);
    padding: 20px;
    border-radius: 12px;
}

.color-option-large {
    width: 100%;
    height: 60px;
    border-radius: 10px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.color-option-large:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.color-option-large.selected {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.5);
    transform: scale(1.05);
}

.color-option-large.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* İkon Seçimi */
.edit-icon-section {
    margin-bottom: 20px;
}

.btn-clear-icon {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ff6b6b;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.btn-clear-icon:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

.icon-picker-scroll {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.icon-picker-scroll::-webkit-scrollbar {
    width: 6px;
}

.icon-picker-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.icon-picker-scroll::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.icon-option {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.5rem;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.icon-option:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: scale(1.1);
}

.icon-option.selected {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Action Butonlar */
.edit-action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 25px;
}

.btn-action-cancel {
    padding: 16px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    color: #b0b3b8;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-cancel:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #e4e6eb;
}

.btn-action-save {
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-action-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-action-save:active {
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .users-grid {
        grid-template-columns: repeat(auto-fit, 140px);
        gap: 15px;
    }

    .user-box {
        width: 140px;
        height: 140px;
    }

    .saved-user-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .plus-icon {
        font-size: 4rem;
    }

    .login-panel {
        width: calc(100% - 40px);
        max-width: 420px;
        padding: 30px 25px;
    }

    .login-panel h2 {
        font-size: 1.5rem;
    }

    .confirm-modal, .edit-modal {
        width: calc(100% - 40px);
        padding: 25px 20px;
    }

    .confirm-modal-title {
        font-size: 1.2rem;
    }

    .confirm-modal-buttons {
        flex-direction: column;
    }

    .toast-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
    }

    .color-picker-large {
        grid-template-columns: repeat(4, 1fr);
    }

    .icon-picker-scroll {
        grid-template-columns: repeat(5, 1fr);
    }

    .edit-modal {
        max-height: 90vh;
    }

    .edit-profile-card {
        padding: 15px;
    }

    .edit-profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .edit-profile-info h3 {
        font-size: 1.2rem;
    }

    .color-picker-large {
        padding: 15px;
        gap: 10px;
    }

    .color-option-large {
        height: 50px;
    }

    .icon-picker-scroll {
        max-height: 180px;
        grid-template-columns: repeat(6, 1fr);
    }

    .edit-action-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ── Küçük Mobil (≤575px) ── */
@media (max-width: 575.98px) {

    .page-header {
        padding-bottom: 12px;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .users-grid {
        gap: 12px;
        padding: 0 4px;
    }

    .saved-user-name {
        font-size: 0.82rem;
    }

    .plus-icon {
        font-size: 3.5rem;
    }

    .login-panel {
        width: calc(100% - 24px);
        padding: 24px 18px;
        max-height: 88vh;
        overflow-y: auto;
    }

    .login-panel h2 {
        font-size: 1.3rem;
        margin-bottom: 18px;
    }

    .input-wrapper input {
        padding: 13px 14px;
        font-size: 0.95rem;
    }

    .btn-login {
        padding: 13px;
    }
}
