﻿/* ==================== فونت ==================== */
@font-face {
    font-family: 'Vazir';
    src: url('../fonts/Vazir.woff2') format('woff2'), url('../fonts/Vazir.woff') format('woff');
    font-weight: 400;
    font-style: normal;
}

/* ==================== تنظیمات پایه ==================== */
 * {
    font-family: 'Vazir' !important;
    box-sizing: border-box;
}

body {
    direction: rtl;
    background: linear-gradient(180deg, #d9d9d999 0%, #f5f7fa 100%);
    margin: 0;
    padding: 20px;
    min-height: 100vh;
}

.auth-page:before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background-image: url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(2px);
    -webkit-filter: blur(2px);
}

/* ==================== لاگین و ثبت نام ==================== */
    .login-container, .register-box {
    margin: auto;
    background: white;
    padding: 35px;
    border-radius: 12px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.1);
    width: 400px;
    max-width: 95%;
}

    .login-container h2,
    .register-box h2 {
        text-align: center;
        color: #2d3748;
        margin-bottom: 30px;
        font-size: 24px;
    }

/* ==================== فرم‌ها ==================== */
.form-group {
    margin-bottom: 18px;
}

    .form-group label {
        display: block;
        margin-bottom: 6px;
        color: #4a5568;
        font-weight: 600;
        font-size: 14px;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        width: 100%;
        padding: 10px 14px;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        transition: all 0.3s ease;
        background: #f7fafc;
    }

        .form-group input:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #4299e1;
            box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
            background: white;
        }

        .form-group input::placeholder {
            color: #a0aec0;
        }

.password-hint {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 5px;
}

/* ==================== دکمه‌ها ==================== */
.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
.text-red{
    color: red;
}
    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .btn:active {
        transform: translateY(0);
    }

.btn-block {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    justify-content: center;
}

/* رنگ‌های دکمه */
.btn-primary {
    background: #4299e1;
    color: white;
}

    .btn-primary:hover {
        background: #3182ce;
    }

.btn-success {
    background: #48bb78;
    color: white;
}

    .btn-success:hover {
        background: #38a169;
    }

.btn-danger {
    background: #fc8181;
    color: white;
}

    .btn-danger:hover {
        background: #f56565;
    }

.btn-warning {
    background: #ed8936;
    color: white;
}

    .btn-warning:hover {
        background: #dd6b20;
    }

.btn-secondary {
    background: #a0aec0;
    color: white;
}

    .btn-secondary:hover {
        background: #718096;
    }

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-xs {
    padding: 3px 10px;
    font-size: 11px;
}

.btn-login {
    background: #48bb78;
    color: white;
}

    .btn-login:hover {
        background: #38a169;
    }

.btn-logout {
    background: #fc8181;
    color: white;
    padding: 6px 18px;
    font-size: 13px;
}

    .btn-logout:hover {
        background: #f56565;
    }

.mt-10 {
    margin-top: 10px;
}
/* ==================== پیام‌ها ==================== */
.error-message,
.msg-error {
    color: #e53e3e;
    text-align: center;
    padding: 12px 16px;
    background: #fff5f5;
    border-radius: 8px;
    border-right: 4px solid #fc8181;
    display: none;
    margin: 10px 0;
    font-size: 14px;
}

.success-message,
.msg-success {
    color: #276749;
    text-align: center;
    padding: 12px 16px;
    background: #f0fff4;
    border-radius: 8px;
    border-right: 4px solid #48bb78;
    display: none;
    margin: 10px 0;
    font-size: 14px;
}

    .error-message.show,
    .success-message.show,
    .msg-error.show,
    .msg-success.show {
        display: block;
    }

/* ==================== لینک‌ها ==================== */
.login-link,
.register-link {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #edf2f7;
}

    .login-link a,
    .register-link a {
        color: #4299e1;
        text-decoration: none;
        font-weight: 600;
    }

        .login-link a:hover,
        .register-link a:hover {
            text-decoration: underline;
        }

/* ==================== صفحه اصلی ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 25px 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
}

/* ==================== هدر ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 18px;
    margin-bottom: 25px;
    border-bottom: 3px solid #ebf4ff;
    flex-wrap: wrap;
    gap: 12px;
}

    .header h1 {
        color: #2d3748;
        margin: 0;
        font-size: 22px;
    }

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.user-info {
    background: #ebf8ff;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    color: #2b6cb0;
    font-size: 14px;
}

/* ==================== بخش‌ها ==================== */
.section-title {
    color: #2d3748;
    margin: 25px 0 15px 0;
    font-size: 17px;
    font-weight: 700;
}

/* ==================== فرم جستجو ==================== */
.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

    .search-box input {
    
        min-width: 200px;
        padding: 9px 16px;
        border: 2px solid #e2e8f0;
        border-radius: 8px;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    .search-box .search_input {
        flex: 4;
        background: #f7fafc;
    }

    .search-box .search_btn {
        flex: 1;
    }
    .search-box input:focus {
        outline: none;
        border-color: #4299e1;
        box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
        background: white;
    }

/* ==================== جدول ==================== */
.grid {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 14px;
}

    .grid th {
        background: #ebf8ff;
        color: #2b6cb0;
        padding: 10px 14px;
        text-align: right;
        font-weight: 700;
        border: 1px solid #bee3f8;
    }

    .grid td {
        padding: 10px 14px;
        border: 1px solid #dbdbdb;
        vertical-align: middle;
    }

    .grid tr:hover {
        background: #f7fafc;
    }

    .grid .actions {
        text-align: center;
        white-space: nowrap;
    }

        .grid .actions .btn {
            margin: 0 3px;
        }

.empty-msg {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
    font-size: 16px;
}

/* ==================== پنل اضافه کردن (سریع) ==================== */
.add-panel {
    background: #f7fafc;
    padding: 18px 22px;
    border-radius: 10px;
    border: 2px dashed #e2e8f0;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

    .add-panel .form-group {
        margin-bottom: 0;
        flex: 1;
        min-width: 140px;
    }

        .add-panel .form-group label {
            font-size: 12px;
            margin-bottom: 3px;
        }

        .add-panel .form-group input {
            padding: 8px 12px;
            font-size: 13px;
        }

    .add-panel .btn {
        padding: 8px 24px;
        height: 42px;
        align-self: center;
    }

/* ==================== مودال ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

    .modal-overlay.show {
        display: flex;
    }

.modal-box {
    background: white;
    border-radius: 16px;
    padding: 30px 35px;
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

    .modal-box h3 {
        color: #2d3748;
        margin: 0 0 20px 0;
        font-size: 20px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .modal-box .form-group {
        margin-bottom: 16px;
    }

        .modal-box .form-group label {
            font-size: 13px;
            margin-bottom: 4px;
        }

        .modal-box .form-group input {
            padding: 9px 14px;
            font-size: 14px;
        }

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 2px solid #edf2f7;
}

    .modal-actions .btn {
        padding: 10px 28px;
        font-size: 14px;
    }

/* ==================== انیمیشن‌ها ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==================== ریسپانسیو ==================== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-left {
        width: 100%;
        justify-content: space-between;
    }

    .login-container,
    .register-box {
        padding: 20px;
        width: 100%;
    }

    .add-panel {
        flex-direction: column;
        padding: 15px;
    }

        .add-panel .form-group {
            min-width: 100%;
        }

        .add-panel .btn {
            width: 100%;
            justify-content: center;
        }

    .search-box input {
        min-width: 100%;
    }

    .grid {
        font-size: 12px;
        display: block;
        overflow-x: auto;
    }

        .grid th,
        .grid td {
            padding: 6px 10px;
            white-space: nowrap;
        }

    .modal-box {
        padding: 20px;
        margin: 10px;
    }

    .modal-actions {
        flex-wrap: wrap;
    }

        .modal-actions .btn {
            flex: 1;
            justify-content: center;
        }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 18px;
    }

    .user-info {
        font-size: 12px;
        padding: 4px 12px;
    }

    .btn {
        font-size: 12px;
        padding: 6px 14px;
    }
}
