/* Import a modern font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* Define a professional color palette */
:root {
    --primary-color: #5A67D8; /* A nice Indigo */
    --success-color: #38A169; /* Green */
    --error-color: #E53E3E;   /* Red */
    --background-color: #F7FAFC;
    --card-bg-color: #FFFFFF;
    --text-color: #2D3748;
    --muted-text-color: #718096;
    --border-color: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: var(--card-bg-color);
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}
.app-header h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-color);
}
.app-header a {
    text-decoration: none;
    color: var(--muted-text-color);
    font-weight: 500;
    transition: color 0.2s;
}
.app-header a:hover { color: var(--primary-color); }

/* Scanner Container */
#scanner-container {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

/* General Card Style */
.card {
    background: var(--card-bg-color);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}
.card h2, .card h3 {
    text-align: left;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Form Styling */
.form-group { margin-bottom: 1rem; }
label { font-weight: 500; font-size: 0.9rem; margin-bottom: 0.5rem; display: block; }
input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease-in-out;
}
input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.3);
}

/* Button Styling */
.btn {
    display: block;
    align-items: center;
    justify-content: center;
    width: 87%;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s 
ease-in-out;
    position: relative;
    margin: 20px;
}
.btn-success { background-color: var(--success-color); color: white; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-danger { background-color: var(--error-color); color: white; }
.btn-secondary { background-color: var(--muted-text-color); color: white; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 14px rgba(50,50,93,.1), 0 3px 6px rgba(0,0,0,.08); }
.btn:active { transform: translateY(0); }

/* Loading Spinner for button */
.btn .spinner {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    display: none;
}
.btn.loading .btn-text { opacity: 0; }
.btn.loading .spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* New Inventory Item List Style */
#items-container { display: flex; flex-direction: column; gap: 1rem; }
.inventory-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: #F7FAFC;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.inventory-item .info .name { font-weight: 600; font-size: 1.1rem; }
.inventory-item .info .details { font-size: 0.9rem; color: var(--muted-text-color); }
.inventory-item .actions { display: flex; gap: 0.5rem; }
.inventory-item .action-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 0.5rem; border-radius: 50%; transition: background-color 0.2s; }
.inventory-item .action-btn:hover { background-color: #E2E8F0; }

/* Status Messages */
#status-message { margin-top: 1rem; padding: 0.8rem; border-radius: 8px; font-weight: 500; display: none; }
#status-message.success { background-color: #C6F6D5; color: #22543D; display: block; }
#status-message.error { background-color: #FED7D7; color: #822727; display: block; }



/* استایل‌های مودال جدید */
#new-product-modal .modal-content {
    max-width: 400px;
}
#new-product-barcode-display {
    color: var(--primary-color);
    font-weight: 600;
}


/* اضافه کردن به style.css */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    z-index: 1000;
    box-sizing: border-box;
}

.back-btn {
    font-size: 1.2rem;
    color: #333;
    margin-right: 15px;
    text-decoration: none;
    padding: 5px;
}

@media (max-width: 480px) {
    .username-text {
        display: none; /* در موبایل فقط آیکون یوزر نمایش داده شود تا شلوغ نشود */
    }
}