/* ============================================
   EMPLOYEE SETUP PAGE
   ============================================ */

/* Password Protection Modal */
.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--teal-primary) 0%, var(--teal-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.password-modal-content {
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 50px 60px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.password-header svg {
    margin-bottom: 20px;
}

.password-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.password-header p {
    font-size: 15px;
    color: var(--gray-600);
    margin-bottom: 30px;
}

.password-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.password-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    text-align: center;
    letter-spacing: 2px;
}

.password-input:focus {
    outline: none;
    border-color: var(--teal-primary);
    box-shadow: 0 0 0 3px rgba(90, 172, 168, 0.1);
}

.password-input.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.password-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--teal-primary), var(--teal-dark));
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(90, 172, 168, 0.3);
}

.password-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(90, 172, 168, 0.4);
}

.password-submit-btn:active {
    transform: translateY(0);
}

.back-to-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 10px;
    transition: all 0.3s ease;
}

.back-to-home-link:hover {
    color: var(--teal-primary);
}

.password-error {
    margin-top: 16px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
}

.password-error.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.setup-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

.setup-header {
    text-align: center;
    margin-bottom: 40px;
}

.setup-header .logo-container {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    padding: 15px;
}

.setup-header .company-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.setup-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.setup-header p {
    font-size: 16px;
    color: var(--gray-600);
    margin-bottom: 20px;
}

.back-link {
    display: inline-block;
    color: white;
    background: var(--teal-primary);
    text-decoration: none;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.back-link:hover {
    background: var(--teal-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.setup-content {
    display: grid;
    gap: 30px;
}

.form-card,
.employees-list-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-md);
}

.form-card h2,
.employees-list-card h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.instruction {
    font-size: 14px;
    color: var(--gray-600);
    margin-bottom: 30px;
    padding: 12px;
    background: var(--teal-subtle);
    border-left: 4px solid var(--teal-primary);
    border-radius: var(--radius-sm);
}

.photo-upload-section {
    margin-bottom: 30px;
}

.upload-area {
    border: 3px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-area:hover {
    border-color: var(--teal-primary);
    background: var(--teal-subtle);
}

.upload-area.dragover {
    border-color: var(--teal-primary);
    background: var(--teal-lighter);
}

.upload-icon {
    color: var(--gray-400);
    margin-bottom: 15px;
}

.upload-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 5px;
}

.upload-hint {
    font-size: 13px;
    color: var(--gray-500);
}

.photo-preview {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.photo-preview.hidden {
    display: none;
}

.photo-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.remove-photo {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.remove-photo:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.face-status {
    padding: 12px;
    margin-top: 15px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
}

.face-status.success {
    background: rgba(15, 169, 104, 0.1);
    color: var(--success);
    border: 2px solid var(--success);
}

.face-status.error {
    background: rgba(220, 38, 38, 0.1);
    color: var(--error);
    border: 2px solid var(--error);
}

.face-status.processing {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    border: 2px solid var(--warning);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--teal-primary);
    box-shadow: 0 0 0 3px var(--teal-lighter);
}

.form-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    flex: 1;
    background: var(--teal-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--teal-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-small {
    padding: 10px 16px;
    font-size: 14px;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--gray-100);
}

.employees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.employee-card {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.2s ease;
}

.employee-card:hover {
    border-color: var(--teal-primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.employee-card .card-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
    overflow: hidden;
    border: 3px solid var(--teal-primary);
}

.employee-card .card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.employee-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
    text-align: center;
}

.employee-card .card-info {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 4px;
}

.employee-card .card-info strong {
    color: var(--gray-800);
}

.employee-card .card-badge {
    display: inline-block;
    padding: 6px 12px;
    background: var(--success);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 10px;
}

.employee-card .delete-btn {
    width: 100%;
    margin-top: 15px;
    background: var(--error);
    color: white;
    padding: 10px;
    font-size: 13px;
}

.employee-card .delete-btn:hover {
    background: #b91c1c;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-overlay p {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .list-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .employees-grid {
        grid-template-columns: 1fr;
    }
}
